会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
EM-LGH
I'll be on my own trip I'm out ya
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
31
32
33
34
35
36
37
38
39
···
120
下一页
2019年12月23日
BZOJ 5110: [CodePlus2017]Yazid 的新生舞会 线段树
摘要: 非常好的一道思维题. 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
阅读(124)
评论(0)
推荐(0)
2019年12月21日
BZOJ 4009: [HNOI2015]接水果 整体二分+DFS序+扫描线
摘要: 以前一直以为这道题很恶心,事实证明还好,好多地方脑残写丑了. code: #include <cstdio> #include <string> #include <cstring> #include <algorithm> #define N 50003 using namespace std;
阅读全文
posted @ 2019-12-21 16:00 EM-LGH
阅读(207)
评论(0)
推荐(0)
BZOJ 4491: 我也不知道题目名字是什么 线段树+离线
摘要: 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
阅读(151)
评论(0)
推荐(0)
模拟赛T2 线段树优化建图+tarjan+拓扑排序
摘要: 然而这只是 70pts 的部分分,考场上没想到满分怎么做(现在也不会) code: #include <cstdio> #include <string> #include <stack> #include <queue> #include <cstring> #include <algorithm
阅读全文
posted @ 2019-12-21 08:38 EM-LGH
阅读(199)
评论(0)
推荐(0)
2019年12月20日
模拟赛 T1 费马小定理+质因数分解+exgcd
摘要: 求:$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
阅读(266)
评论(0)
推荐(0)
模拟赛 T3 DFS序+树状数组+树链的并+点权/边权技巧
摘要: 题意:给定一颗树,有 $m$ 次操作. 操作 0 :向集合 $S$ 中加入一条路径 $(p,q)$,权值为 $v$ 操作 1 :给定一个点集 $T$,求 $T$ 的并集与 $S$ 中路径含交集的权和.(就是如果路径 $i$ 与 $T$ 有交集,就产生 $v_{i}$ 的贡献) 数据范围:路径长度 $
阅读全文
posted @ 2019-12-20 17:56 EM-LGH
阅读(266)
评论(0)
推荐(0)
2019年12月19日
BZOJ 3132: 上帝造题的七分钟 树状数组+差分
摘要: 这个思路很巧妙啊 ~ 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
阅读(159)
评论(0)
推荐(0)
BZOJ 5161: 最长上升子序列 状压dp+查分
摘要: 好神啊 ~ 打表程序: #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
阅读(135)
评论(0)
推荐(0)
【洛谷P3835】 【模板】可持久化平衡树
摘要: 可持久化非旋转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
阅读(141)
评论(0)
推荐(0)
2019年12月18日
BZOJ 1458: 士兵占领 最大流
摘要: 判断有没有解:让所有没有障碍的格子都放一个士兵. 那么,题中要求最少放几个士兵,就是最多拿走几个士兵. 而由于行和列对士兵个数都是由要求的,这就规定了拿走的士兵的上界. 跑一个最大流来求就行了. code: #include <cstdio> #include <queue> #include <a
阅读全文
posted @ 2019-12-18 20:17 EM-LGH
阅读(168)
评论(0)
推荐(0)
上一页
1
···
31
32
33
34
35
36
37
38
39
···
120
下一页
公告