摘要: #include <bits/stdc++.h> #define inf 2333333333333333 #define N 1000010 #define p(a) putchar(a) #define For(i,a,b) for(int i=a;i<=b;++i) //by war //20 阅读全文
posted @ 2020-08-04 23:25 WeiAR 阅读(130) 评论(0) 推荐(0) 编辑
摘要: #include <bits/stdc++.h> #define inf 2333333333333333 #define N 3000010 #define p(a) putchar(a) #define For(i,a,b) for(int i=a;i<=b;++i) //by war //20 阅读全文
posted @ 2020-08-04 22:10 WeiAR 阅读(165) 评论(0) 推荐(0) 编辑
摘要: 最小环模板 floyed http://acm.hdu.edu.cn/showproblem.php?pid=1599 #include <bits/stdc++.h> #define inf 2333333333333 #define N 210 #define p(a) putchar(a) # 阅读全文
posted @ 2020-08-04 21:26 WeiAR 阅读(142) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=3041 X所在的行向列建边,跑二分图 #include<iostream> #include<cstdio> #include<queue> #include<algorithm> #include<cmath> #include<ctime> 阅读全文
posted @ 2020-08-04 20:56 WeiAR 阅读(100) 评论(0) 推荐(0) 编辑
摘要: CodeForces - 1208E 经典滑动窗口问题,如果以物体为参考系的话。前缀和优化区间操作 #include <bits/stdc++.h> #define inf 2333333333333333 #define N 1000010 #define p(a) putchar(a) #def 阅读全文
posted @ 2020-08-04 20:42 WeiAR 阅读(124) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1469 网络流跑二分图模板题 #include<iostream> #include<cstdio> #include<queue> #include<algorithm> #include<cmath> #include<ctime> #inc 阅读全文
posted @ 2020-08-04 20:33 WeiAR 阅读(71) 评论(0) 推荐(0) 编辑
摘要: 如果 I 和 I’ 在同一强连通分量中,那么肯定 I 能到达 i’ , I’ 能到达 i,所以无解。如果 I 和 I’ 不在同一强连通分量中,那么对缩点后的新图进行拓扑排序,我们选择拓扑序大的点,而拓扑序大的点肯定是到达不了拓扑序小的点的,根据DFS做法中的证明,我们可以证明我们的选择一定合法。而我 阅读全文
posted @ 2020-08-04 11:19 WeiAR 阅读(121) 评论(0) 推荐(0) 编辑
摘要: 2-sat模板题 矛盾体之间错开建边,最后缩点,看同一个夫妻在一个联通块中。 #include <bits/stdc++.h> #define inf 23333333333333 #define N 3010 #define p(a) putchar(a) #define For(i,a,b) f 阅读全文
posted @ 2020-08-04 10:18 WeiAR 阅读(105) 评论(0) 推荐(0) 编辑