Preface 这次CC难度较上两场升高了许多,后面两题都只能借着曲明姐姐和jz姐姐的仙气来做 值得一提的是原来的F大概需要大力分类讨论,结果我写了一大半题目就因为原题被ban了233 最后勉强涨了近200分,下场如果不出意外地话应该可以打到六星.(ORZ七星julao LTL) A Chef and Maximum Star Value SB题,可以设一个阈值统计也可以直接根号大暴力,反正都能过 #include<cstdio> #include<iostream> #defin…
Preface 老年菜鸡终于开始打CC了,由于他太弱了所以只能打Div2 因为台风的原因challenge并没有写,所以水了个Rank7 A Football SB模拟题不解释 #include<cstdio> #include<iostream> #define RI register int using namespace std; const int N=155; int t,n,a[N],b[N],ans; int main() { for (scanf("%d&…
Maximum Remaining 题意:给n个数,取出两个数$a_{i}$,$a_{j}$,求$a_{i}\% a_{j}$取模的最大值 直接排个序,第二大(严格的第二大)模第一大就是答案了. #include <bits/stdc++.h> using namespace std; int a[(int)1e6]; int main() { ios::sync_with_stdio(false); cin.tie(); int n; cin >> n; ; i < n;…
A. Definite Game 题目链接:https://codeforces.com/contest/1081/problem/A 题意: 给出一个数v,然后让你可以重复多次减去一个数d,满足v%d!=0,问最后可以得到最小的是多少. 题解: 除开v=2输出2,其余直接输出1就行了= =/ 代码如下: #include <bits/stdc++.h> using namespace std; int main(){ int v; cin>>v; cout<<(v==…
目录 Missing a Point Chefina and Swaps Doctor Chef Chef and Dragon Dens LCM Constraints Weird Product Expected Repetitions Expected Spanning Trees 要看题解可以看 FSYo 写的,反正都是他跟我讲的做法,我一道都不会. Missing a Point 模拟. code Chefina and Swaps 贪心. code Doctor Chef dp. c…
目录 Triple Sort Sorting Vases Buying a New String Chef and Bitwise Product Binary Land Not a Real World Problem Chef and Rainbow Roadsolved Precise Bipartite Pairing Precise Pairing 又咸了一场比赛... 这次除了 Challenge 还有两道都不会,自闭了... stO 陈阿克 rank < 5 Triple Sort…
Subtree Removal 很显然不可能选择砍掉一对有祖先关系的子树.令$f_i$表示$i$子树的答案,如果$i$不被砍,那就是$a_i + \sum\limits_j f_j$:如果$i$被砍,那就是$-x$.取个$max$就好了. 时间.空间复杂度$O(n)$. #include <bits/stdc++.h> using namespace std; ; int tc, n, xx; int a[N]; vector<int> g[N]; long long f[N];…
https://www.codechef.com/DEC17/problems/GIT01 #include<cstdio> #include<algorithm> using namespace std; #define N 101 char s[N]; int main() { int T; scanf("%d",&T); int n,m; int OddG,OddR,EvenG,EvenR; int ans; while(T--) { OddG=O…