The 2021 CCPC Guilin Onsite 补题+总结 A. Hero Named Magnus 题意:签到输出2n-1; 12345678910111213141516171819202122#include<bits/stdc++.h>using namespace std;typedef long long ll;#define f(a,b,c) for(ll a=b;a<c;a++)void solve(){ ll 2023-12-10 XCPC > vp #补题
Codeforces 1823B Sort with Step Codeforces 1823B Sort with Step题目大意:给你两种操作数组的方式(1)隔k交换,可任意进行,(2)任意交换,只能进行一次。问只有一次任意交换机会和任意次交互机会能否使数组非降序排序。 解题思路:此题用a存储原数组,b数组存储改数字当前位置,判断当前数字位置是否与这个数字应该在的位置间的差对k求余是否等于零即可判断是否需要强转。由于题目说原数组是数列,所以方法是可行的。 2023-11-10 XCPC > Codeforces > 900 #思维 #排序
天梯赛训练 7-10 h0253.鸣人和佐助 题目:鸣人和佐助背景佐助被大蛇丸诱骗走了,鸣人在多少时间内能追上他呢? 已知一张地图(以二维矩阵的形式表示)以及佐助和鸣人的位置。地图上的每个位置都可以走到,只不过有些位置上有大蛇丸的手下,需要先打败大蛇丸的手下才能到这些位置。鸣人有一定数量的查克拉,每一个单位的查克拉可以打败一个大蛇丸的手下。假设鸣人可以往上下左右四个方向移动,每移动一个距离需要花费1个单位时间,打败大蛇丸的手下不需要时间。如果 2023-10-10 XCPC > 天梯赛 > L2 #图论
Codeforces 1826B_Lunatic Never Content Codeforces 1826B Lunatic Never Content题目大意:给出一堆数,各自取同一个mod,让你判断当mod取多少时,这堆数可构成回文串。 解题思路:考察gcd,连续gcd 代码:12345678910111213141516171819202122#include<bits/stdc++.h>using namespace std;typedef long 2023-09-10 XCPC > Codeforces > 1000 #思维 #数学
Codeforces 1826A_Trust Nobody Codeforces 1826A Trust Nobody题目大意:一群人中有人说谎,每人报出他所知道的说谎人数,让你根据信息判断说谎人数是否能确定。 解题思路:这题可以假设一个i作为假想说谎人数,再通过模拟即可解题 代码:12345678910111213141516171819202122232425262728293031#include<bits/stdc++.h>using 2023-05-10 XCPC > Codeforces > 800 #思维 #模拟
typora配置图片自动上传gihub图床 最近将博客从github-page静态托管搬到了服务器,不能豪横使用流量,于是萌生了建立图床的想法,对比了很多方案,还是直接使用github托管最为合适。 但这又产生一个问题,如果只是单纯使用git推送图片会很麻烦,写作体验感不好,又不想使用PicGo等软件,于是有此文。 进入typora -> 偏好设置 -> 图像 到upgit-releases拉取最新程序 下载好 2023-02-06 技术笔记 > 配置笔记 > Typora > Upgit > GitHub #Typora #Upgit #写作所需
Codeforces 1750A. Indirect Sort A. Indirect Sort You are given a permutation a1,a2,…,an of size n, where each integer from 1 to n appears exactly once. You can do the following operation any number of times (possibly, zero): Choose 2022-11-20
Codeforces 1744D. Divisibility by 2^n D. Divisibility by 2^ntime limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given an array of positive integers a1,a2,…,an. Make the product of 2022-11-19
Codeforces 1744B. Even-Odd Increments time limit per test2 secondsmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou are given n of integers a1,a2,…,an. Process q queries of two types: query of the form “0 xj”: 2022-11-18
Codeforces 1744C. Traffic Light C. Traffic Lighttime limit per test1 secondmemory limit per test256 megabytesinputstandard inputoutputstandard outputYou find yourself on an unusual crossroad with a weird traffic light. That traffic 2022-11-18