2019年10月23日

网络流最大费用流整理

摘要: https://blog.csdn.net/jianxingzhang/article/details/81208814 dinic算法 https://www.cnblogs.com/graytido/p/10809211.html why dinic算法分层能优化时间 HDU 3549 多源点多 阅读全文

posted @ 2019-10-23 00:01 chengyulala 阅读(122) 评论(0) 推荐(0) 编辑

2019年10月21日

codeforces 图论题目集(持续更新)

摘要: 简单题,反正菜 Dasha Code Championship - SPb Finals Round (only for onsite-finalists) A. Anadi and Domino https://codeforces.com/problemset/problem/1210/A 思路 阅读全文

posted @ 2019-10-21 12:57 chengyulala 阅读(455) 评论(0) 推荐(1) 编辑

2019年10月20日

整数快速幂

摘要: https://www.cnblogs.com/sun-of-Ice/p/9330352.html 取模运算一般情况下是需要的,当然也可以省去。 POJ 1995 阅读全文

posted @ 2019-10-20 17:46 chengyulala 阅读(138) 评论(0) 推荐(0) 编辑

Codeforces Codeforces Global Round 5 C2

摘要: https://codeforces.com/contest/1237/problem/C2 平面上的点可以把 x 轴坐标相等的点临近消除,剩余每个x轴只剩一个节点,临近相消除就好了,转换为三维则先消除x , y 轴坐标相等的节点就好了. 阅读全文

posted @ 2019-10-20 14:10 chengyulala 阅读(124) 评论(0) 推荐(0) 编辑

2019年10月18日

POJ 1061

摘要: 补充下定理: 定理一:如果d = gcd(a, b),则必能找到正的或负的整数k和l,使d = a*k + b*l。 证明:由于 gcd(a, 0) = a,我们可假设b ≠ 0,这样通过连除我们能够写出 a = b*q1 + r1 b = r1*q2 + r2 r1 = r2*q3 + r3 …… 阅读全文

posted @ 2019-10-18 18:23 chengyulala 阅读(217) 评论(0) 推荐(0) 编辑

2019年10月15日

扩展欧几里德算法(数论)

摘要: #include<bits/stdc++.h> #define llinf (0x3f3f3f3f3f3f3f3f) #define inf (0x3f3f3f3f) typedef long long i64; using namespace std; i64 exgcd(i64 a,i64 b, 阅读全文

posted @ 2019-10-15 19:48 chengyulala 阅读(154) 评论(0) 推荐(0) 编辑

Codeforces Round #592 (Div. 2) 1224D

摘要: http://codeforces.com/problemset/problem/1244/D 暴力为一条链染色 阅读全文

posted @ 2019-10-15 17:29 chengyulala 阅读(105) 评论(0) 推荐(0) 编辑

2019年10月12日

Codeforces Round #582 (Div. 3) G. Path Queries

摘要: https://codeforces.com/contest/1213/problem/G(图论) 思路:保证每次加入的边一定不会小于现存的图中的边,因为题目保证了一定为一棵树,所以每次加入的边必定属于不同的集合,计算下每个集合的个数,新加入的边一定会增加 sum[u] * sum[v] 所属不同集 阅读全文

posted @ 2019-10-12 15:52 chengyulala 阅读(91) 评论(0) 推荐(0) 编辑

2019年10月10日

E. Petya and Construction Set

该文被密码保护。 阅读全文

posted @ 2019-10-10 22:27 chengyulala 阅读(1) 评论(0) 推荐(0) 编辑

Codeforces Round #583 (Div. 1 + Div. 2, based on Olympiad of Metropolises) D. Treasure Island

该文被密码保护。 阅读全文

posted @ 2019-10-10 18:16 chengyulala 阅读(1) 评论(0) 推荐(0) 编辑

导航