摘要:
题目链接 "luogu P4178 Tree" 题解 点分治 代码 c++ // luogu judger enable o2 include include inline int read() { int x = 0,f = 1 ; char c = getchar(); while(c '9') 阅读全文
摘要:
题解 另g = gcd(a1,a2,a3....) 那么k g % m的方案书就是答案 这个式子子显然是有循环节的 x g = 0 mod m ,x g + y m = 0 exgcd 后 x = x0 + k (m/gcd(g,m)) 也是就m/gcd(g,m) 代码 c++ include in 阅读全文
摘要:
题目链接 "bzoj3111: [Zjoi2013]蚂蚁寻路" 题解 发现走出来的图是一向上的凸起锯齿状 对于每个突出的矩形dp一下就好了 代码 c++ / / include include const int maxn = 127; inline int read() { int x = 0,f 阅读全文
摘要:
题目链接 "bzoj5293: [Bjoi2018]求和" 题解 暴力 对于lca为1的好坑啊.... 代码 c++ include include include inline int read() { int x = 0,f = 1; char c = getchar(); while(c '9 阅读全文