摘要: 代码: 步骤: 1. 将代码存储为judge.sh 2. 在终端运行 chmod +x judge.sh 3. 在终端运行 ./judge.sh 阅读全文
posted @ 2017-04-13 20:40 Krew 阅读(691) 评论(0) 推荐(0) 编辑
摘要: 网络流序号要考虑超级源和超级汇 SAP要记得即使还原当前弧 二分图匹配中v、w要取局部变量 RMQ时记得开大数组 树链剖分记得结点要变为线段树中的下标 阅读全文
posted @ 2017-01-03 18:44 Krew 阅读(196) 评论(0) 推荐(0) 编辑
摘要: ``` include include include include include define rep(i,x,y) for (int i=x;i=x;i ) define sz(x) (int)(x.size()) using namespace std; typedef long long 阅读全文
posted @ 2016-09-05 22:46 Krew 阅读(290) 评论(0) 推荐(0) 编辑
摘要: 树的Prufer编码及应用: http://www.mengchunlei.net/2015/06/21/%E6%A0%91%E7%9A%84prufer%E7%BC%96%E7%A0%81/ http://blog.csdn.net/bingshangjiguang/article/details 阅读全文
posted @ 2016-08-16 20:33 Krew 阅读(310) 评论(0) 推荐(0) 编辑
摘要: 在输入输出量十分大的时候,为了优化I/O时间,可以编写自己的输入输出函数,原理:逐字符输入输出比有cstdio快。 include include include include include define rep(i,x,y) for (int i=x;i=x;i ) using namespa 阅读全文
posted @ 2016-04-01 20:13 Krew 阅读(314) 评论(0) 推荐(0) 编辑
摘要: Vector:不定长数组 Vector是C++里的不定长数组,相比传统数组vector主要更灵活,便于节省空间,邻接表的实现等。而且它在STL中时间效率也很高效:几乎与数组不相上下。 实际上vector还有push_front()等操作,但从前端插入会 引起大量元素移动 ,浪费大量时间,不提倡使用。 阅读全文
posted @ 2016-01-21 15:34 Krew 阅读(220) 评论(0) 推荐(0) 编辑