摘要:
一直WA……找了半天错的发现居然是解密那里的mask其实是不能动的……传进去的会变,但是真实的那个不会变…… 然后就是后缀自动机,用LCT维护parent树了……注意不能makeroot,因为自动机的根是不会变的(同理也不能翻转区间),其实就是低配LCT(?) cpp include include 阅读全文
摘要:
就是非旋treap的板子 cpp include include include using namespace std; const int N=500005,mod=73939133,bs=997687623; int q,tot,rt,st=123; struct qwe { int c[2] 阅读全文
摘要:
必败状态是倒序排列,也就是正序对为0 然后发现,每次翻转都是有奇数个数对(\\( C_{4x+2}^{2} C_{4x+3}^{2} \\) 都是奇数),所以每次翻转丢回改变正反数对的奇偶性 又因为偶数为必败状态,所以顺序对为奇数则必胜 cpp include include using names 阅读全文
摘要:
必败状态是n为偶数并且数量相同的石子堆可以两两配对,因为这样后手可以模仿先手操作 其他状态一定可以由先手给后手一步拼出一个必败状态(用最大堆补) cpp include include include using namespace std; const int N=100005; int n,a[ 阅读全文
摘要:
也就是转换到树形删边游戏,详见 https://wenku.baidu.com/view/25540742a8956bec0975e3a8.html cpp include include include using namespace std; const int N=1005; int T,n, 阅读全文
摘要:
预处理出SG函数,然后像普通nim一样做即可 cpp include include using namespace std; const int N=10005; int k,s[N],m,n,sg[N],v[N],ti,ans; int read() { int r=0,f=1; char p= 阅读全文
摘要:
如果全是1,那么n是奇数先手必败 否则,xor和为0先手必败 证明见 https://www.cnblogs.com/Wolfycz/p/8430991.html cpp include include using namespace std; const int N=55; int T,n,a[N 阅读全文
摘要:
把连边和不连边看成黑白染色,然后就变成了 https://www.cnblogs.com/lokiii/p/10055629.html 这篇讲得好!https://blog.csdn.net/wzq_qwq/article/details/48035455 cpp include include u 阅读全文
摘要:
和bzoj 4503 https://www.cnblogs.com/lokiii/p/10032311.html 差不多,就是再乘上一个原串字符 有点卡常,先在点值下算最后一起IDFT cpp include include include include using namespace std; 阅读全文
摘要:
还是没有理解透原根……题目提示其实挺明显的,M是质数,然后1 include include using namespace std; const int N=20005,mod=1004535809,g=3; int n,m,x,k,s[N],d=2,id[N],lm,bt,re[N]; long 阅读全文
摘要:
扩展中国剩余定理板子 cpp include include using namespace std; const int N=100005; int n; long long m[N],r[N],M,R,x,y,d; void exgcd(long long a,long long b,long 阅读全文
摘要:
扩展中国剩余定理的板子,合并完之后算一下范围内能取几个值即可(记得去掉0) cpp include include include using namespace std; const int N=15; int T,n,m; long long a[N],b[N],A,B,x,y,d; bool 阅读全文
摘要:
用生成函数套路推一推,推完老想NTT……实际上把这个多项式乘法看成dp然后前缀和优化一下即可 cpp include include using namespace std; const int N=1005,mod=1000000; int n,m,c[N],l,r,f[N 100],s[N],s 阅读全文
摘要:
根据套路列出式子:\\( \prod_{i=1}^{n}\sum_{j=0}^{c[i]}\frac{x^j}{j!} \\),然后暴力展开即可 cpp include include include using namespace std; const int N=205; int n,m,c[N 阅读全文