上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 120 下一页
摘要: 非常好的一道思维题. code: #include <cstdio> #include <cstring> #include <algorithm> #include <vector> #define lson x<<1 #define rson x<<1|1 #define N 500010 #d 阅读全文
posted @ 2019-12-23 15:43 EM-LGH 阅读(119) 评论(0) 推荐(0) 编辑
摘要: 以前一直以为这道题很恶心,事实证明还好,好多地方脑残写丑了. code: #include <cstdio> #include <string> #include <cstring> #include <algorithm> #define N 50003 using namespace std; 阅读全文
posted @ 2019-12-21 16:00 EM-LGH 阅读(197) 评论(0) 推荐(0) 编辑
摘要: code: #include <string> #include <cstring> #include <cstdio> #include <algorithm> #define N 50003 #define lson now<<1 #define rson now<<1|1 #define in 阅读全文
posted @ 2019-12-21 09:33 EM-LGH 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 然而这只是 70pts 的部分分,考场上没想到满分怎么做(现在也不会) code: #include <cstdio> #include <string> #include <stack> #include <queue> #include <cstring> #include <algorithm 阅读全文
posted @ 2019-12-21 08:38 EM-LGH 阅读(187) 评论(0) 推荐(0) 编辑
摘要: 求:$a^{bx \%p}\equiv 1(\mod p)$ 的一个可行的 $x$. 根据欧拉定理,我们知道 $a^{\phi(p)}\equiv 1(\mod p)$ 而在 $a^x\equiv 1(\mod p)$ 这个式子中 $x$ 是存在很多个解的. 这些解之间存在着循环节,使得任意解 $x 阅读全文
posted @ 2019-12-20 18:58 EM-LGH 阅读(255) 评论(0) 推荐(0) 编辑
摘要: 题意:给定一颗树,有 $m$ 次操作. 操作 0 :向集合 $S$ 中加入一条路径 $(p,q)$,权值为 $v$ 操作 1 :给定一个点集 $T$,求 $T$ 的并集与 $S$ 中路径含交集的权和.(就是如果路径 $i$ 与 $T$ 有交集,就产生 $v_{i}$ 的贡献) 数据范围:路径长度 $ 阅读全文
posted @ 2019-12-20 17:56 EM-LGH 阅读(252) 评论(0) 推荐(0) 编辑
摘要: 这个思路很巧妙啊 ~ code: #include <cstdio> #include <algorithm> #define N 2050 #define ll int #define setIO(s) freopen(s".in","r",stdin) using namespace std; 阅读全文
posted @ 2019-12-19 20:48 EM-LGH 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 好神啊 ~ 打表程序: #include <cstdio> #include <cstring> #include <algorithm> #define N 140000000 #define ll long long #define mod 998244353 #define setIO(s) 阅读全文
posted @ 2019-12-19 14:07 EM-LGH 阅读(126) 评论(0) 推荐(0) 编辑
摘要: 可持久化非旋转treap,真的是又好写又好调 ~ code: #include <cstdio> #include <cstdlib> #include <algorithm> #define N 500007 #define lson t[x].ls #define rson t[x].rs #d 阅读全文
posted @ 2019-12-19 09:44 EM-LGH 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 判断有没有解:让所有没有障碍的格子都放一个士兵. 那么,题中要求最少放几个士兵,就是最多拿走几个士兵. 而由于行和列对士兵个数都是由要求的,这就规定了拿走的士兵的上界. 跑一个最大流来求就行了. code: #include <cstdio> #include <queue> #include <a 阅读全文
posted @ 2019-12-18 20:17 EM-LGH 阅读(160) 评论(0) 推荐(0) 编辑
上一页 1 ··· 31 32 33 34 35 36 37 38 39 ··· 120 下一页