上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 36 下一页

2011年5月31日

poj 2570

摘要: #include<iostream>#include<fstream>using namespace std;int n;int map[201][201];void read(){// ifstream cin("in.txt"); int i,j,k; char c[30]; while(cin>>n) { if(n==0) return; memset(map,0,sizeof(map)); while(cin>>i>>j) { if(i==0&&j==0) break; cin>> 阅读全文

posted @ 2011-05-31 10:31 宇宙吾心 阅读(158) 评论(0) 推荐(0)

poj 2457

摘要: #include<iostream>#include<fstream>#include<queue>using namespace std;struct e{ int data; e *next;};e edge[50001];void add(int s,int t){ e *p=new e; p->data=t; p->next=edge[s].next; edge[s].next=p;}int path[50001];int v[50001];int n,m;int solve(){ int i,j,k; queue<int> 阅读全文

posted @ 2011-05-31 10:30 宇宙吾心 阅读(209) 评论(0) 推荐(0)

poj 2135

摘要: #include<iostream>#include<fstream>#include<queue>using namespace std;struct e{ int data; int c,f; int w; e *next; e *opt;};e edge[1010];int total;int n,m;void add(int s,int t,int h,int w){ e *p=new e; p->data=t; p->c=h; p->f=0; p->w=w; p->next=edge[s].next; edge[s]. 阅读全文

posted @ 2011-05-31 10:29 宇宙吾心 阅读(238) 评论(0) 推荐(0)

2011年5月30日

poj 2584

摘要: #include<iostream>#include<fstream>#include<queue>using namespace std;struct e{ int data; int c,f; e *next; e *opt;};e edge[40];int n,m,total;int x[40],y[40];int mark[300];void add(int s,int t,int w){ e *p=new e; p->data=t; p->c=w; p->f=0; p->next=edge[s].next; edge[s]. 阅读全文

posted @ 2011-05-30 18:01 宇宙吾心 阅读(245) 评论(0) 推荐(0)

poj 2724

摘要: #include<iostream>#include<fstream>using namespace std;int n,m;int v[2000];int a[2][2000];int map[520][520];int link[520];int vis[520];int dfs(int s){ int i; for(i=1;i<=m;i++) if(vis[i]==0&&map[s][i]) { vis[i]=1; if(link[i]==-1||dfs(link[i])) { link[i]=s; return 1; } } return 阅读全文

posted @ 2011-05-30 11:21 宇宙吾心 阅读(189) 评论(0) 推荐(0)

poj 2949

摘要: #include<iostream>#include<fstream>using namespace std;int n;struct e{ int s,t; double w;};e edge[100001];char c[1002];int mid;int top;void add(int s,int t,int w){ edge[++top].s=s; edge[top].t=t; edge[top].w=w;}double d[27*27];int solve(){ int i,j,k; for(i=1;i<=26*26;i++) d[i]=-100000 阅读全文

posted @ 2011-05-30 11:10 宇宙吾心 阅读(394) 评论(0) 推荐(0)

poj 3160

摘要: #include<iostream>#include<fstream>using namespace std;struct e{ int data; e *next;};e edge[30001],edge1[30001];int n,m;void add(int s,int t){ e *p=new e; p->data=t; p->next=edge[s].next; edge[s].next=p;}int v[30001],dfn[30001],low[30001],top,scc[30001],sta[30001];int total;int ind 阅读全文

posted @ 2011-05-30 10:33 宇宙吾心 阅读(402) 评论(0) 推荐(0)

2011年5月29日

poj 3228

摘要: #include<iostream>#include<fstream>using namespace std;int n,m,ans;struct e{ int s,t,w;};e edge[40001];int f[401];int cmp(const void *a,const void *b){ return (*(e*)a).w-(*(e*)b).w;}int father(int s){ if(s!=f[s]) f[s]=father(f[s]); return f[s];}int a[401];void unionset(int s,int t){ int 阅读全文

posted @ 2011-05-29 19:05 宇宙吾心 阅读(390) 评论(0) 推荐(0)

poj 3255

摘要: #include<iostream>#include<fstream>#include<queue>using namespace std;struct e{ int data; int cost; e *next;};e edge[5001];struct node{ int data; int kind; int weight; friend bool operator <(node a,node b){ return a.weight>b.weight; }};int n,m;void add(int s,int t,int w){ e * 阅读全文

posted @ 2011-05-29 18:27 宇宙吾心 阅读(294) 评论(0) 推荐(0)

poj 3275

摘要: #include<iostream>#include<fstream>using namespace std;int n,m;int a[1001][1001];int b[1001][1001];int map[1001][1001];void read(){// ifstream cin("in.txt"); int i,j,k,s,t; cin>>n>>m; for(i=1;i<=m;i++) { cin>>j>>k; a[++a[0][j]][j]=k; b[++b[0][k]][k]=j 阅读全文

posted @ 2011-05-29 18:26 宇宙吾心 阅读(218) 评论(0) 推荐(0)

上一页 1 ··· 8 9 10 11 12 13 14 15 16 ··· 36 下一页

导航