-
奖金
谁应该高谁的入度++,并记录下谁比低的高(低的得出度),所以入度为零的就是最低的(好不公平),找出所有最低的,将他们算作一层,奖金++(算是拓补排序吧) 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556#include<cstdio&g …
-
团伙
反集的反集不是朋友。。。要是把他们合并便多了1234567891011121314151617181920212223242526272829303132333435363738//并查集+反集的思想 #include<cstdio>#include<iostream>using namespace std;int n,m;int flag;int flag1[9999]; …
-
银河英雄传说
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253#include<cstdio>#include<iostream>#include<algorithm>#include<cstring>using nam …
-
食物链
12345678100 71 101 12 1 22 2 32 3 31 1 32 3 11 5 5 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859#include<cstdio>using namespace st …
-
爱在心中
12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210 …
-
封锁阳光大学
二分图染色 12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758#include<cstdio>#include<vector>#include<cstring>using namespace std; …
-
骑马修栅栏
123456789101112131415161718192021222324252627282930313233343536373839404142434445#include<cstdio>using namespace std;int a[999][999];int n,m;int z=1;int b[9999];int t=0;int du[9999];void dfs(int …
-
牛的é旅行
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162#include<cstdio>#include<iostream>#include<cmath>using namespace st …
-
最小花费
简单的spfa。。但我就纳闷了,为啥数组模拟邻接表却tle12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#include <cstdio>#include<cstring>using namespace std;int du[99999];in …
-
lca最小公共祖先
倍增12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849#include <cstdio>#include<cstring>using namespace std;int du[99999];int flag[2999];double dis[209 …