The 2021 CCPC Guilin Onsite 补题+总结 A. Hero Named Magnus 题意:签到输出2n-1; 1234567891011121314151617181920#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 x; 2023-10-18 CCPC #补题
Codeforces 1823B Sort with Step Codeforces 1823B Sort with Step题目大意: 2023-05-06 ACM #思维 #贪心 #codeforces:1100
Codeforces 1826B_Lunatic Never Content Codeforces 1826B Lunatic Never Content题目大意:给出一堆数,各自取同一个mod,让你判断当mod取多少时,这堆数可构成回文串。 解题思路:考察gcd,连续gcd 代码:1234567891011121314151617181920#include<bits/stdc++.h>using namespace std;typedef long long 2023-05-06 ACM #思维 #借鉴 #数学 #codeforces:1000
Codeforces 1826A_Trust Nobody Codeforces 1826A Trust Nobody题目大意:一群人中有人说谎,每人报出他所知道的说谎人数,让你根据信息判断说谎人数是否能确定。 解题思路:这题可以假设一个i作为假想说谎人数,再通过模拟即可解题 代码:1234567891011121314151617181920212223242526272829#include<bits/stdc++.h>using name 2023-05-06 ACM #思维 #借鉴 #模拟 #codeforces:800
Codefoces 1821B Sort the Subarray Codeforces 1821B Sort the Subarray题目大意:判断最大排序范围。 解题思路:思维僵化复建ing,太久不写题想复杂了,最后借鉴了才恍然大悟。其实只要判断修改过的就可以了,在在此基础上向两侧延伸直到b数组不符合非降序即可 代码:我原写的: (样例也过了一些,但是改来改去始终卡);;; 1234567891011121314151617181920212223242526 2023-05-04 ACM #思维 #借鉴 #贪心 #codeforces:1100
Codeforces 1823B Sort with Step Codeforces 1823B Sort with Step题目大意:给你两种操作数组的方式(1)隔k交换,可任意进行,(2)任意交换,只能进行一次。问只有一次任意交换机会和任意次交互机会能否使数组非降序排序。 解题思路:此题用a存储原数组,b数组存储改数字当前位置,判断当前数字位置是否与这个数字应该在的位置间的差对k求余是否等于零即可判断是否需要强转。由于题目说原数组是数列,所以方法是可行的。 2023-05-04 ACM #思维 #排序 #codeforces:900
Codeforces 1605C. Dominant Character Ashish has a string ss of length nn containing only characters ‘a‘, ‘b‘ and ‘c‘. He wants to find the length of the smallest substring, which satisfies the following conditions: Length of the substri 2022-11-15
Codeforces 39D. Cubical Planet You can find anything whatsoever in our Galaxy! A cubical planet goes round an icosahedral star. Let us introduce a system of axes so that the edges of the cubical planet are parallel to the coordinat 2022-11-15
Codeforces 1255B. Fridge Lockers Hanh lives in a shared apartment. There are nn people (including Hanh) living there, each has a private fridge. nn fridges are secured by several steel chains. Each steel chain connects two different 2022-11-15