摘要:
看一个图是否时二分图,是的话输出染色方案,不是的话输出任意一个奇环。 找到奇环直接回溯即可。 #include <bits/stdc++.h> using namespace std; const int M = 3e5+7; int n,m; int flg,cnt,head[M]; int co 阅读全文
摘要:
无向图的最小路径覆盖。 找出联通块里所有的奇度点,然后两个两个的点互相连边,构造成所有点都是偶度数。 然后就找联通块里有多少条欧拉回路,如果回路中有新加的边则答案++。 #include <bits/stdc++.h> using namespace std; const int M = 1e5+7 阅读全文
摘要:
water,给一个数n,问从1...n的数字里最少删去多少数字让剩下的数字必不可能组成三角形。 保留的数字必定是1、2、3、5、8、13、21.....这样的数字。 //#define test #include<bits/stdc++.h> using namespace std; const i 阅读全文
摘要:
water //#define test #include<bits/stdc++.h> using namespace std; const int Nmax=1e6+7; typedef long long ll; struct LL { ll a,b; LL(){ } LL(ll aa,ll 阅读全文