上一页 1 ··· 8 9 10 11 12 13 14 15 下一页
摘要: 1 #include 2 using namespace std; 3 const int maxn=5005; 4 const int maxm=200005; 5 struct node{ 6 int cnt,fa; 7 }f[maxn]; 8 inline void read(int &tmp) 9 { 10 int x=1;char c=getchar(... 阅读全文
posted @ 2019-01-13 10:41 宇興 阅读(190) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int maxn=5005; 4 const int INF=0x3f3f3f3f; 5 inline void read(int &tmp) 6 { 7 int x=1;char c=getchar(); 8 for(tmp=0;!isdigit(c);c=getchar()) ... 阅读全文
posted @ 2019-01-13 10:41 宇興 阅读(172) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int maxn=505; 4 const int maxm=100005; 5 int n,k,sum,tot; 6 struct node{ 7 int cnt,fa; 8 }f[maxn]; 9 int find(int x){return f[x].fa==x?x:f[x].fa... 阅读全文
posted @ 2019-01-13 10:39 宇興 阅读(254) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int maxn=5050; 4 const int maxm=5000005; 5 int n,m,k,ans; 6 double Max; 7 int monkey[maxn]; 8 typedef pair P; 9 P point[maxn]; 10 #define Dis(x,y) (... 阅读全文
posted @ 2019-01-13 10:28 宇興 阅读(194) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int maxn=505; 4 const int maxm=100005; 5 int n,k,Max,tot; 6 struct node{ 7 int cnt,fa; 8 }f[maxn]; 9 int find(int x){return f[x].fa==x?x:f[x].fa... 阅读全文
posted @ 2019-01-13 10:28 宇興 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 typedef long long ll; 4 ll m,n,x,y,l,t,k,d; 5 void exgcd(ll a,ll b,ll &x,ll &y) {if(!b) {x=1;y=0;d=a;return;}exgcd(b,a%b,y,x);y-=x*(a/b);} 6 int main() 7 { ... 阅读全文
posted @ 2019-01-13 10:27 宇興 阅读(133) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 性质:一个树里,删掉n条边一定出现n+1个连通块 3 若删去无向连通图中所有权值大于m的边,原图被分割成k个连通块,则最小生成树也被分割成k个联通块 4 */ 5 #include 6 using namespace std; 7 const int maxn=505; 8 const int maxm=250005; 9 struct node{int cn... 阅读全文
posted @ 2019-01-13 10:26 宇興 阅读(173) 评论(0) 推荐(0) 编辑
摘要: 1 /* 2 用kuskal会被卡 3 一边prim一边算两点间距离(边权) 4 否则会MLE 5 另:不开long long见祖宗 6 */ 7 #include 8 using namespace std; 9 const int maxn=5005; 10 const int INF=0x3f3f3f3f; 11 typedef pair P; 12 priority... 阅读全文
posted @ 2019-01-13 10:21 宇興 阅读(214) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int maxn=500005; 4 inline void read(int &tmp) 5 { 6 int x=1;char c=getchar(); 7 for(tmp=0;!isdigit(c);c=getchar()) if(c=='-') x=-1; 8 for... 阅读全文
posted @ 2019-01-13 10:18 宇興 阅读(103) 评论(0) 推荐(0) 编辑
摘要: 1 #include 2 using namespace std; 3 const int maxn=10005; 4 const int maxm=100005; 5 const int INF=0x3f3f3f3f; 6 inline void read(int &tmp) 7 { 8 int x=1;char c=getchar(); 9 for(tmp... 阅读全文
posted @ 2019-01-13 10:17 宇興 阅读(204) 评论(0) 推荐(0) 编辑
上一页 1 ··· 8 9 10 11 12 13 14 15 下一页