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

2011年5月29日

poj 3594

摘要: #include<iostream>#include<fstream>#include<queue>using namespace std;struct e{ int data; int b,h,c; e *next;};e edge[101];int n,m;int start,end;int d[10001][101];struct node{ int time; int weight; int data; friend bool operator <(node a,node b){ return a.weight>b.weight; }}; 阅读全文

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

poj 3281

摘要: #include<iostream>#include<fstream>#include<queue>using namespace std;int n,f,d;struct e{ int data; int c,f; e *next; e *opt;};e edge[500];int total;int h[500];int build(){ int i,j,k; memset(h,0,sizeof(h)); queue<int> q; q.push(0); h[0]=1; while(!q.empty()) { i=q.front(); q.p 阅读全文

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

poj 3310

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

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

poj 3311

摘要: #include<iostream>#include<fstream>using namespace std;int n;int map[14][14];int a[14];int ans;void solve(int s,int t){ int i,j,k; if(ans!=-1&&t>ans) return; if(s==n) { if(ans==-1) ans=t+map[a[s]][0]; else ans=min(ans,t+map[a[s]][0]); return; } for(i=s+1;i<=n;i++) { swap(a[ 阅读全文

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

poj 3328

摘要: #include<iostream>#include<fstream>#include<queue>using namespace std;int n,m;int map[61][31];int sx[61],sy[31];int end[61][31];int top;int d[2][61][31];struct node{ int s,t; int kind; int weight; friend bool operator <(node a,node b){ return a.weight>b.weight; }};int v[2][61 阅读全文

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

2011年5月28日

poj 1135

摘要: 代码:#include<iostream>#include<fstream>#include<queue>using namespace std;struct e{ int data; int cost; e *next;};e edge[501];int n,m;void add(int s,int t,int w){ e *p=new e; p->data=s; p->cost=w; p->next=edge[t].next; edge[t].next=p; e *q=new e; q->data=t; q->cost=w; 阅读全文

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

poj 3653

摘要: 代码:#include<iostream>#include<fstream>#include<queue>using namespace std;int n,m;int total;struct e{ int data; int cost; e *next;};e edge[500];struct node{ int data; int w; friend bool operator <(node a,node b){ return a.w>b.w; }};int d[500],v[500];void solve(){ int i,j,k; me 阅读全文

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

poj 3662

摘要: 代码:#include<iostream>#include<fstream>#include<queue>using namespace std;int n,m,l;struct e{ int data; int cost; e *next;};e edge[1001];void add(int s,int t ,int w){ e *p=new e; p->data=s; p->cost=w; p->next=edge[t].next; edge[t].next=p; e *q=new e; q->data=t; q->cos 阅读全文

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

poj 3686

摘要: 代码:#include<iostream>#include<fstream>using namespace std;int n,m;int link[2501],x[51],y[2501],lx[51],ly[2501];int map[51][51];int w[51][2501];int dfs(int s){ x[s]=1; for(int i=1;i<=m;i++) if(y[i]==0&&lx[s]+ly[i]==w[s][i]) { y[i]=1; if(link[i]==-1||dfs(link[i])) { link[i]=s; r 阅读全文

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

poj 1523

摘要: 代码:#include<iostream>#include<fstream>using namespace std;struct e{ int data; e *next;};e edge[1001];void add(int i,int j){ e *p=new e; p->data=j; p->next=edge[i].next; edge[i].next=p; e *q=new e; q->data=i; q->next=edge[j].next; edge[j].next=q;}int dfn[1001],v[1001],low[1001 阅读全文

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

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

导航