rprp
rprp
全部文章
数据结构
动态规划(12)
图论(6)
字符串(3)
搜索(1)
数学(6)
未归档(2)
贪心(5)
配置(2)
归档
标签
去牛客网
登录
/
注册
rprp的博客
全部文章
/ 数据结构
(共5篇)
Luogu P3812 【模板】线性基
线性基板子题 #include <cstdio> using namespace std; #define R register #define LL long long LL p[52]; LL n; inline void ins(LL x) { for(R int i=51;i...
线性基
位运算
2020-05-01
0
418
Luogu P3857 [TJOI2008]彩灯
把每个对应的序列看成二进制数,能控制就把这一位设为\(1\),那么每异或出来一个新的数就对应一种情况。 根据线性基的性质,任意一个子集异或和都不一样,所以直接线性基即可。 #include <cmath> #include <cstdio> #include <cst...
线性基
位运算
2020-05-01
0
469
Luogu P4301 [CQOI2013]新Nim游戏
Nim游戏的结论就是先手异或和不为0的时候必胜,所以就排个序,留下线性基就行了。 #include <cmath> #include <cstdio> #include <cstring> #include <algorithm> using nam...
Nim
线性基
2020-05-01
0
467
HDU 3949 XOR
线性基板子题,注意特判\(0\),开\(long~long\)就好。 #include <cstdio> #include <cstring> using namespace std; #define R register #define LL long long #def...
线性基
2020-05-01
0
368
线性基小结
用处 没用我学这东西干嘛 快速查询一个数是否可以被一堆数异或出来 快速查询一堆数可以异或出来的最大/最小值 快速查询一堆数可以异或出来的第k大值 这么点? 还有点性质在下面 可能有点用 性质 原数列里的任何一个数都可以通过线性基里的数异或表示出来 线性基里任意一...
线性基
2020-05-01
0
401