摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2647#include #include #include #define LL long longusing namespace std;int head[10006],cnt=0;int val[10006];int in[10006];int n,m,num;queueq;struct node{ int u,v; int next;} edge[20010];void add(int u,int v){ edge[cnt].u = u; edge[cnt].v = v; ... 阅读全文
posted @ 2014-02-27 14:55 N_ll 阅读(197) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2094 1 #include 2 #include 3 #include 4 using namespace std; 5 const int N=1010; 6 int num = 0,in[N]; 7 string name[N]; 8 int get_nameid(string s) 9 {10 int i;11 for (i = 0; i = num)15 name[num++] = s;16 return i;17 }18 int main()19 {2... 阅读全文
posted @ 2014-02-27 14:52 N_ll 阅读(276) 评论(0) 推荐(0)
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1285 1 #include 2 #include 3 const int N=1001; 4 int p[N][N],in[N]; 5 int n,m; 6 void toposort() 7 { 8 for (int i = 1; i <= n; i++) 9 {10 for (int j = 1; j <= n; j++)11 {12 if(in[j]==0)13 {14 ... 阅读全文
posted @ 2014-02-27 14:49 N_ll 阅读(166) 评论(0) 推荐(0)