摘要:
CF1939F 尝试:看到只有 \(n-2\) 条被删了,一共少了 \(2n-4\) 的度数,说明一定有 \(n-1\) 或 \(n-2\) 度的点。 然鹅看了半天感觉没有用。再看询问,给了 \(n\) 次,那只能是吧 \(1\) 到 \(n\) 都询问一遍。 于是问题变为:已知度数为 \(i\) 阅读全文
摘要:
令一个点的权值为其到根的经过的边的异或和 注意到可以将操作视为交换两个点的权值 #include<bits/stdc++.h> using namespace std; #define i128 __int128 #define ll long long #define ull unsigned l 阅读全文
摘要:
通过一些手段,可以将这题转化为CF280D 于是在过完样例后,一发入魂AC了,喜 #include<bits/stdc++.h> using namespace std; #define i128 __int128 #define ll long long #define ull unsigned 阅读全文
摘要:
不定期更新~ Trick 1.令 \(b_i=a_i-i\),可以将等差数列转化为相同的数 例题:ABC371F 2.对于只和数据间大小关系相关的问题,可以考虑二分答案,并转化为01序列 例题:P2824 3.在博弈题目中,考虑是不是存在一种决策完全优于另一种,可以简化问题 例题:CF2005E1 阅读全文
摘要:
花30分钟发现lg翻译出错了 又花30分钟学习欧拉回路怎么求 再花30分钟等待codeforces的queue #include<bits/stdc++.h> using namespace std; int t,n,m; vector<int> res; struct edge{ int v,w, 阅读全文
摘要:
考场真是困傻了,这都不会 横的放左边k列,竖的放上边k行,优先放能消的位置 #include<bits/stdc++.h> using namespace std; int t,n,m,k,q,a[105][105]; char s[1005]; int x[105],y[105]; int mai 阅读全文
摘要:
A. Maximize the Last Element 很明显只有奇数项可以留到最后,所以取奇数项的max即可 #include<bits/stdc++.h> using namespace std; int t,n,a[105]; int main(){ scanf("%d",&t); whil 阅读全文
摘要:
怎么是树状数组板子,这也蓝 #include<bits/stdc++.h> using namespace std; int n,m,q,a[305][305]; int c[305][305][105]; void add(int x,int y,int k,int col){ for(int i 阅读全文
摘要:
可爱的单调性啊,不会 #include<bits/stdc++.h> using namespace std; #define int long long int n,m,q,u,v,t,a[100005]; queue<int> que[3]; signed main(){ scanf("%lld 阅读全文
摘要:
唐氏小状压 #include<bits/stdc++.h> using namespace std; #define lowbit(x) (x&-(x)) int t,n,c,k,cnt[(1<<18)+5][35]; bool f[(1<<18)+5]; char s[(1<<18)+5]; in 阅读全文