2011年6月1日

poj 2139

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

posted @ 2011-06-01 17:06 宇宙吾心 阅读(327) 评论(0) 推荐(0)

poj 2349

摘要: #include<iostream>#include<fstream>#include<cmath>using namespace std;int n,m;struct e{ int s,t; double w;};e edge[250001];int x[501],y[501];int top;void add(int s,int t,double w){ edge[++top].s=s; edge[top].t=t; edge[top].w=w;};int cmp(const void *a,const void *b){ if( (*(e*)a).w& 阅读全文

posted @ 2011-06-01 17:02 宇宙吾心 阅读(275) 评论(0) 推荐(0)

poj 2075

摘要: #include<iostream>#include<fstream>using namespace std;struct e{ int s,t; double w;};e edge[250001];int n,m;char c[501][30];int cmp(const void *a,const void *b){ if ((*(e*)a).w>(*(e*)b).w) return 1; return -1;}int top;void add(int s,int t,double w){ edge[++top].s=s; edge[top].t=t; edg 阅读全文

posted @ 2011-06-01 17:01 宇宙吾心 阅读(253) 评论(0) 推荐(0)

导航