摘要: 1001 对 \(link-cut-tree\) 有所了解的选手不难发现,操作 \(1\) 是在模拟 \(lct\) 的 \(access\) 操作 于是操作 \(1\) 可以在 \(lct\) 虚实边切换的时候用一个线段树区间修改,同时维护操作 \(4\) 的答案 操作 \(2\) 相当于单点询问 阅读全文
posted @ 2021-08-03 22:08 Acception 阅读(38) 评论(0) 推荐(0)
摘要: declval作用:返回模板参数类型的右值引用 decltype作用:起别名 #include <utility> using namespace std; class A{}; class B{ public: A m; } decltype(declval<B>().m) n1; 阅读全文
posted @ 2021-08-02 21:15 Acception 阅读(127) 评论(0) 推荐(0)
摘要: 常用: using T = typename remove_reference<decltype(*declval<it>())>::type; template <typename T> class remove_reference { public: typedef T type; }; tem 阅读全文
posted @ 2021-08-02 02:32 Acception 阅读(44) 评论(0) 推荐(0)
摘要: int __builtin_clz(unsigned long long int a){ int res=0; while(!(a&0x80000000)){///0x80000000 = 1ll<<31 res++; a<<=1; } return res; } 阅读全文
posted @ 2021-08-02 02:02 Acception 阅读(240) 评论(0) 推荐(0)
摘要: A. Gregor and Cryptography 构造... #include <bits/stdc++.h> #define all(a) a.begin(),a.end() #define pb push_back using namespace std; using ll = long l 阅读全文
posted @ 2021-08-02 01:51 Acception 阅读(32) 评论(0) 推荐(0)
摘要: ##A. PizzaForces 打表就会神奇的发现规律(当时想错了错好几发) #include "bits/stdc++.h" #define pll __builtin_popcount #define all(a) a.begin(),a.end() #define pb push_back 阅读全文
posted @ 2021-07-31 01:23 Acception 阅读(51) 评论(0) 推荐(0)
摘要: A. Cherry 贪心 #include <bits/stdc++.h> #define all(a) a.begin(),a.end() #define pb push_back using namespace std; using ll = long long ; int test(int n 阅读全文
posted @ 2021-07-30 01:21 Acception 阅读(41) 评论(0) 推荐(0)
摘要: ... 阅读全文
posted @ 2021-07-30 01:18 Acception 阅读(11) 评论(0) 推荐(0)
摘要: ... 5 4 3 2 5 1(用树状数组$a[i]-n$) 0 0 0 1 1 0 0 1 2 2 0 1 2 3 3 0 1 2 3 4 1 2 3 4 5 #include <iostream> using namespace std; int a[200010], p[200010], t[ 阅读全文
posted @ 2021-07-27 00:02 Acception 阅读(67) 评论(0) 推荐(0)
摘要: A题 题意:找到$S(x)>S(x+1)$的数在$x∈(0,n)$的范围内的个数S(x)是x的个数数字的和。容易发现x的末尾数字是9时S(x)>S(x+1) 才成立。所以答案是x/10+(x%10==9) #include <bits/stdc++.h> #define re register #d 阅读全文
posted @ 2021-07-23 01:40 Acception 阅读(84) 评论(2) 推荐(0)