直接在矩阵上进行floyd在判断即可View Code #include<stdio.h>int map[110][110];int vis[110][110];int main(){ int t,n,i,j,k; int cases=1; scanf("%d",&t); while(t--) { scanf("%d",&n); int tot=n*(n-1); for(i=1;i<=n;i++) for(j=1;j<=n;j++) { scanf(... Read More
posted @ 2011-09-11 21:39 Because Of You Views(156) Comments(0) Diggs(0) Edit
View Code #include<stdio.h>#include<math.h>#include<string.h>struct PEAK{ double x,h;}p[1100];struct bit{ double x,v,m;}pat[1100];int main(){ int G=20; double h; int t,cases=1,i,j,n,m,w; scanf("%d",&t); while(t--) { double v0=0,temp; scanf("%d%d%d",&n,&a Read More
posted @ 2011-09-11 21:19 Because Of You Views(306) Comments(0) Diggs(0) Edit