上一页 1 ··· 70 71 72 73 74 75 76 77 78 ··· 99 下一页

2011年5月1日

整数解

摘要: #include<stdio.h>#include<math.h>int main( ){ int a,b,t; while(scanf("%d%d",&a,&b),a|b){ t=sqrt(a*a-4*b); printf(a*a-4*b>=0&&(a*a-4*b-t*t==0)?"YES\n":"NO\n"); }return 0;}数学题。。 阅读全文

posted @ 2011-05-01 09:25 more think, more gains 阅读(209) 评论(0) 推荐(0) 编辑

2011年4月30日

More is better

摘要: #include<stdio.h>#include<stdlib.h>#include<string.h>#define maxn 10000010 int father[maxn],d[maxn];int find(int x){ return x==father[x]?x:father[x]=find(father[x]);}void merge(int x,int y){ x=find(x),y=find(y); if(x!=y) father[x]=y; }int main( ){ int N,i,j,a,b,k,t=0; while(scanf(& 阅读全文

posted @ 2011-04-30 23:51 more think, more gains 阅读(176) 评论(0) 推荐(0) 编辑

how many tables

摘要: #include<stdio.h>#include<stdlib.h>#include<string.h>int father[1100];int find(int x){ return x==father[x]?x:father[x]=find(father[x]);}void merge(int x,int y){ x=find(x),y=find(y); if(x!=y) father[x]... 阅读全文

posted @ 2011-04-30 22:26 more think, more gains 阅读(141) 评论(0) 推荐(0) 编辑

最短路径问题

摘要: #include<stdio.h>#include<stdlib.h>#include<string.h>int N,M;int map[1100][1100],dis[1100],visit[1100],exp[1100][1100],price[1100];const int inf=0x7fffffff;int dij(int x,int y){ int i,j,k,t,p; for(i=1... 阅读全文

posted @ 2011-04-30 22:07 more think, more gains 阅读(146) 评论(0) 推荐(0) 编辑

最短路

摘要: #include<stdio.h>#include<stdlib.h>int N,M;int map[110][110],dis[110],visit[110];const int inf=0x7fffffff;int dij(int x){ int i,j,k,t,p; for(i=0;i<=N;i++) { dis[i]=map[i][1]; visit[i]=0; } dis[0]=0; v... 阅读全文

posted @ 2011-04-30 21:48 more think, more gains 阅读(145) 评论(0) 推荐(0) 编辑

上一页 1 ··· 70 71 72 73 74 75 76 77 78 ··· 99 下一页

导航