2012年6月16日

摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3293水一道排序题。。。希望今晚tc好运~View Code #include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct L{ char location[20],type[20],level[20] ; int ll ;}L ;L kk[501] ;int cmp(const void*a,const void*b){ L*c=(L*)a ; L*d=(L*)b ; if(!strcmp(c 阅读全文
posted @ 2012-06-16 21:15 LegendaryAC 阅读(171) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=1878一个无向图存在欧拉回路,当且仅当该图所有顶点度数都是偶数且该图是连通图。连通图用并查集判断View Code #include using namespace std ;int hash[1002] ;int... 阅读全文
posted @ 2012-06-16 10:50 LegendaryAC 阅读(205) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2407yy题View Code #include <iostream>using namespace std ;int main(){ int n ; while(~scanf("%d",&n)) { double ans=1 ; for(int i=n-1;i>=2;i-=2) ans*=(i-1)*1.0/i ; printf("%.5lf\n",ans) ; } return 0 ;} 阅读全文
posted @ 2012-06-16 08:26 LegendaryAC 阅读(156) 评论(0) 推荐(0) 编辑
 
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=2401水。。View Code #include <iostream>using namespace std ;int main(){ int n,w,d,s ; while(~scanf("%d%d%d%d",&n,&w,&d,&s)) { if(w*n*(n-1)/2==s) printf("%d\n",n) ; else printf("%d\n",(w*n*(n-1)/2-s)/d) ; } ret 阅读全文
posted @ 2012-06-16 08:02 LegendaryAC 阅读(209) 评论(0) 推荐(0) 编辑