2018年5月1日

今日SGU 5.1

摘要: SGU 100 题意: 普通的a+b #include<bits/stdc++.h> #define de(x) cout<<#x<<"="<<x<<endl; #define dd(x) cout<<#x<<"="<<x<<" "; #define rep(i,a,b) for(int i=a;i 阅读全文

posted @ 2018-05-01 20:31 chinacwj1 阅读(166) 评论(0) 推荐(0) 编辑

开始刷SGU

摘要: 计划一天3题 请监督我 谢谢 阅读全文

posted @ 2018-05-01 19:44 chinacwj1 阅读(79) 评论(0) 推荐(0) 编辑

2018年4月23日

网络流最大流dinic的板子

摘要: void add(int u,int v,int w){ e[tot].v=v; e[tot].w=w; e[tot].nt=pre[u]; pre[u]=tot++; e[tot].v=u; e[tot].w=0; e[tot].nt=pre[v]; pre[v]=tot++; } bool bf 阅读全文

posted @ 2018-04-23 23:41 chinacwj1 阅读(108) 评论(0) 推荐(0) 编辑

2018年4月21日

网络流的一些优秀博客

摘要: dinic和ek的区别:https://www.cnblogs.com/y-clever/p/6308820.html 网络流较详细的:https://blog.csdn.net/txl199106/article/details/64441994 阅读全文

posted @ 2018-04-21 23:55 chinacwj1 阅读(93) 评论(0) 推荐(0) 编辑

2018年3月29日

计算几何大佬板子

摘要: struct P { double x,y; P() {} P(double x, double y) { this->x = x; this->y = y; } P operator + (const P &c) const { return P(x + c.x, y + c.y); } P... 阅读全文

posted @ 2018-03-29 17:26 chinacwj1 阅读(209) 评论(0) 推荐(0) 编辑

2018年3月14日

树的小知识

摘要: 求一个树的直径,从任意点出发找到离这个点最远的点s,再从s出发找到离这个点最远的点t,则s-t就是直径 阅读全文

posted @ 2018-03-14 21:55 chinacwj1 阅读(94) 评论(0) 推荐(0) 编辑

2018年3月13日

codeforces 688D

摘要: 题意: 给你n和k,表示有n个数,c1到cn,然后让你求一个数x,可以告诉你x%ci的值,问你是否可以唯一确定一个x%k的值 题解: 反证: 假设有两个x1,x2同时是解,则对于所有ci,x1%ci==x2%ci&&x1%k!=x2%k,及(x1-x2)%ci==0&&(x1-x2)%k!=0, 及 阅读全文

posted @ 2018-03-13 20:18 chinacwj1 阅读(218) 评论(0) 推荐(0) 编辑

转大神的中国剩余定理

摘要: http://blog.csdn.net/HownoneHe/article/details/52186204 https://www.cnblogs.com/linyujun/p/5199415.html 阅读全文

posted @ 2018-03-13 18:51 chinacwj1 阅读(99) 评论(0) 推荐(0) 编辑

2018年2月12日

大佬的矩阵板子

摘要: const int MOD = 1e9 + 7; int add(int a, int b) { if ((a += b) >= MOD) a -= MOD; return a; } int mul(int a, int b) { return 1ll * a * b % MOD; } struct Mat { vector a; Mat() {} Mat(int n, ... 阅读全文

posted @ 2018-02-12 20:06 chinacwj1 阅读(186) 评论(0) 推荐(0) 编辑

2018年1月28日

分组背包的运用

摘要: 上面就是分组背包的基本介绍了,就是n个物品,被分成k组,每组中只能选一件,或者不选, 下面我们来看看codeforces上的一题分组背包的运用,题目连接: http://codeforces.com/contest/742/problem/D 题意:给你n个人,有些人是朋友,要么把朋友圈的人全选,要 阅读全文

posted @ 2018-01-28 16:51 chinacwj1 阅读(193) 评论(0) 推荐(0) 编辑

导航