09 2017 档案

摘要:题做得有点懵B,过来写个题解吧... T1 我只能说思(ji)路(qi)奇(gou)妙(shi) 强制在线就是tmd个幌子 其实是根据las=0 OR 质数,然后反解出opt(神神神%%%) 除了最后一个操作是 询问需要暴力sort外,其他都是推出来的 #include <cstdio> #incl 阅读全文
posted @ 2017-09-30 21:03 A_LEAF 阅读(160) 评论(0) 推荐(0) 编辑
摘要:getget 9.28 证明: 假如我 当前异或出S>0,那一定有一种拿法,使得S==0 现在到了 对手 S==0,那下一个状态S>0 ...... 一直这样下去,石子数一定是一直减少的,所以到了 num==0时,一开始面对的S>0的一方就赢了 ....... 阅读全文
posted @ 2017-09-28 21:20 A_LEAF 阅读(104) 评论(0) 推荐(0) 编辑
摘要:Nim游戏 改成了 拿到最后一个输,所以要躲着拿 get到了新技能:(S为所有堆数异或值) 1.堆数不全是1时 S>0,你可以控制当前这个局面,(因为一定有一个堆数ai>S,你可以取ai-S个石子,使其异或和==0) 否则S==0,你就会被对手控制 2.堆数全是1 显然,此时你面临 奇数堆,必输 特 阅读全文
posted @ 2017-09-28 19:19 A_LEAF 阅读(147) 评论(0) 推荐(0) 编辑
摘要:定理: Nim问题定理:所有堆石子数^和==0是平衡的 平衡的后手赢 不平衡的先手赢 #include <cstdio> #include <cstring> #include <cstdlib> #include <algorithm> #include <iostream> #define ll 阅读全文
posted @ 2017-09-28 18:39 A_LEAF 阅读(101) 评论(0) 推荐(0) 编辑
摘要:线段树维护hash值(记得传L,R的时候不能像平常一样传),wq用bitset水了... #include <cstdio> #include <cstring> #include <iostream> #include <cstdlib> #include <algorithm> #define 阅读全文
posted @ 2017-09-27 11:42 A_LEAF 阅读(121) 评论(0) 推荐(0) 编辑
摘要:任意一个平衡树+hash表(map也可以) 平衡树每个节点维护: 当前子树 最大值、size 下传标记 最大值、sizemax pushdown时候直接更新最后的ans就行了,不用记下来(我就是因为这个炸了...) hash的话 map比较慢 hash表不用双取mod #include <cstdi 阅读全文
posted @ 2017-09-26 18:45 A_LEAF 阅读(140) 评论(0) 推荐(0) 编辑
摘要:好久没有写博客了... 言归正传奥 T1就是个送分题... #include <cstdio> #include <cstring> #include <iostream> #define ll long long #define mem(a,b) memset(a,b,sizeof(a)) usi 阅读全文
posted @ 2017-09-26 16:41 A_LEAF 阅读(245) 评论(0) 推荐(0) 编辑
摘要:T1 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #define ll long long 5 #define dd double 6 #define mem(a,b) memset(a,b,sizeof(a)) 阅读全文
posted @ 2017-09-12 21:23 A_LEAF 阅读(128) 评论(0) 推荐(0) 编辑
摘要:T1 1 #include <cstdio> 2 #include <cstring> 3 #include <iostream> 4 #define ll long long 5 #define mem(a,b) memset(a,b,sizeof(a)) 6 using namespace st 阅读全文
posted @ 2017-09-10 20:23 A_LEAF 编辑