上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页
摘要: 题面很长,其实是道傻逼题,没什么好说的。。。#include #include #include #include #include const int maxn = 1005, maxm = 50005;struct Edge{ int v, w, next; Edge... 阅读全文
posted @ 2015-06-23 13:39 <Dash> 阅读(174) 评论(0) 推荐(0) 编辑
摘要: 二分答案+二分图匹配 时间复杂度:O(n2∗log2n)#include#include#include#include#include#include#include#include#include#include#include#includeconst int maxn = 5... 阅读全文
posted @ 2015-06-21 17:04 <Dash> 阅读(155) 评论(0) 推荐(0) 编辑
摘要: 拓扑排序。注意看题。。。不是输出拓扑序而是输出点在拓扑序中的位置, 感觉只有我会被这种东西坑。。。#include#include#include#include#include#include#include#include#include#include#include#incl... 阅读全文
posted @ 2015-06-21 15:42 <Dash> 阅读(135) 评论(0) 推荐(0) 编辑
摘要: 从高位贪心,高斯消元解异或方程判断是否可行。#include#include#include#include#include#include#include#include#include#include#include#includeconst int logX = 60, max... 阅读全文
posted @ 2015-06-21 14:56 <Dash> 阅读(127) 评论(0) 推荐(0) 编辑
摘要: HLPP算法:http://xingzheqiang.blog.163.com/blog/static/20561012520127464654159/时间复杂度: O(n2∗m−−√) (并不会证明。。。),楼教说对于这种分层图HLPP实际效率更优,不管你信不信,我反正是信了。#i... 阅读全文
posted @ 2015-06-21 13:00 <Dash> 阅读(122) 评论(0) 推荐(0) 编辑
摘要: 参考题解:http://blog.csdn.net/qq_20118433/article/details/45653577贴发代码就跑。。。sgu上的C++编译器开了不稳定的O2优化, 所以我用C++交无限WA on test 16, 用C++_VS提交或改成C语言提交就AC了。。... 阅读全文
posted @ 2015-06-20 21:11 <Dash> 阅读(177) 评论(0) 推荐(0) 编辑
摘要: SPFA最短路,dist(s→t)即为最少颜色数, 答案可以这样构造:对于一条边(u,v),染色为min(max(dist(u),dist(v)),dist(t))为什么可以这么构造?我们可以发现,所有边都为1的情况下, 对于一条边(u,v), dist(v)#include#inc... 阅读全文
posted @ 2015-06-19 23:41 <Dash> 阅读(123) 评论(0) 推荐(0) 编辑
摘要: 去膜拜了一下大神的题解,发现这道构造题并不难。 构造的重点是 保证没有任意两个 2 相邻。 这样就可以使得进位次数很小。具体实现 假设当前加上2p (1) 找到p之后的第一个2的位置x,再找到x之前第一个0的位置y,若y≤p,说明p与x之间有若干个1(可以是0个),我们把2进... 阅读全文
posted @ 2015-06-19 21:36 <Dash> 阅读(143) 评论(0) 推荐(0) 编辑
摘要: KM,把王子放在二分图X侧,妹子放在Y侧,边权为(Ai)2做KM即可, 具体实现时我把王子放在二分图Y侧,妹子放在X侧,这样就更容易输出答案了。#include#include#include#include#include#include#include#include#inclu... 阅读全文
posted @ 2015-06-18 23:05 <Dash> 阅读(132) 评论(0) 推荐(0) 编辑
摘要: 《算法竞赛入门经典:训练指南》上的例题。顺便做了 UVa11762: P143 , 期望DpUva10294,11077,LA3641: P146~149 , Polya定理Uva11762#include#include#include#includeconst int maxn... 阅读全文
posted @ 2015-06-17 22:13 <Dash> 阅读(190) 评论(0) 推荐(0) 编辑
上一页 1 2 3 4 5 6 7 8 9 10 ··· 18 下一页