Fork me on GitHub
摘要: luogu坑: 图可能分为多个连通块,对于每个连通块都要找染色个数较小的那种颜色,sum进ans#include//对于每一块连通分量都应该能够分为二分图 才能够封锁全部的道路,否则Impossible #include#include#include#include#includ... 阅读全文
posted @ 2017-03-03 15:53 primes 阅读(299) 评论(0) 推荐(0)
摘要: vijos#include#include#include#include#include#include#includeusing namespace std;vector a[202];int n,m,dfs_num=0,dfn[202],low[202],color_num... 阅读全文
posted @ 2017-03-01 15:53 primes 阅读(124) 评论(0) 推荐(0)
摘要: vijos描述“每个人都拥有一个梦,即使彼此不相同,能够与你分享,无论失败成功都会感动。爱因为在心中,平凡而不平庸,世界就像迷宫,却又让我们此刻相逢Our Home。” 在爱的国度里有N个人,在他们的心中都有着一个爱的名单,上面记载着他所爱的人(不会出现自爱的情况)。爱是具有传递性... 阅读全文
posted @ 2017-03-01 15:49 primes 阅读(324) 评论(0) 推荐(0)
摘要: luoguvijos两种方法一、带权并查集:问题 front做差#include#include #include#include#include#include#include#includeusing namespace std;int f[50001],front[50000... 阅读全文
posted @ 2017-02-26 11:26 primes 阅读(345) 评论(0) 推荐(0)
摘要: 设置两个数组来记录后面的长度和前面的长度#include#include #include#include#include#include#include#includeusing namespace std;int behind[30010],front[30010],f[300... 阅读全文
posted @ 2017-02-24 13:33 primes 阅读(168) 评论(0) 推荐(0)
摘要: 朴素并查集#include#include#include#include#include#include#includeusing namespace std;int n,m;vector dr[1001];int py[1001];int findpy(int x){ ... 阅读全文
posted @ 2017-02-22 15:51 primes 阅读(230) 评论(0) 推荐(0)
摘要: 题见洛谷最小生成树prim 并点#include#include#include#include #includeusing namespace std;int tu[101][101],dis[101],a[101];int main(){ //freopen("a.i... 阅读全文
posted @ 2017-02-10 11:37 primes 阅读(166) 评论(0) 推荐(0)
摘要: Page 527 出现的 大 错误:ans[ ] 内的数不是一个一个挨着放进去的 !而是按照扫到的范围的顺序放进去 #include<iostream> #include<cstdio> #include<cstring> #include<string> #include<algorithm> u 阅读全文
posted @ 2017-02-10 08:21 primes 阅读(465) 评论(0) 推荐(0)
摘要: #include#include#include#include #includeint n,m;int f[10001];int tree[10001][301];int r[10001],ans=0;using namespace std;int main(){ scan... 阅读全文
posted @ 2017-02-09 16:07 primes 阅读(190) 评论(0) 推荐(0)
摘要: 题见洛谷#include#include#include#include #includeusing namespace std;int deep,n,maxl=0,anst=999999;struct H{ int tim,tall,last;}st[200];int f[... 阅读全文
posted @ 2017-02-09 09:46 primes 阅读(133) 评论(0) 推荐(0)