随笔分类 -  无聊题

 
HDU 2393 Higher Math
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2393判断直角三角形View Code #include <stdio.h>#include <string.h>int main(){ int t; scanf("%d",&t); for(int cas=1;cas<=t;cas++) { int a,b,c; scanf("%d%d%d",&a,&b,&c); printf("Scenario #%d:\n",cas); if(a*a 阅读全文
posted @ 2012-05-25 04:31 LegendaryAC 阅读(219) 评论(0) 推荐(0)
HDU 4163 Stock Prices
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4163稳定排序View Code #include <iostream>#include <cstdlib>#include <cstring>#include <string>#include <stack>#include <queue>#include <map>using namespace std;typedef struct L{ int price; int idx;}L;L kk[1000001];int cm 阅读全文
posted @ 2012-05-24 23:19 LegendaryAC 阅读(211) 评论(0) 推荐(0)
HDU 1872 稳定排序
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1872稳定排序,用一个变量idx记录位置保持稳定View Code #include <iostream>#include <cstdlib>#include <cstring>#include <string>#include <stack>#include <queue>#include <map>using namespace std;typedef struct L{ char name[51]; int score; 阅读全文
posted @ 2012-05-24 22:04 LegendaryAC 阅读(257) 评论(0) 推荐(0)
HDU 1259 ZJUTACM
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1259水题View Code #include <stdio.h>#include <string.h>int main(){ int n,m,x,y,i,a[10]; scanf("%d",&n); while(n--) { memset(a,0,sizeof(a)); a[2]=1; scanf("%d",&m); while(m--) { scanf("%d%d",&x,&y); ... 阅读全文
posted @ 2012-05-14 20:32 LegendaryAC 阅读(182) 评论(0) 推荐(0)
HDU 4079 Happy Telephones
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4079比大小的题。。。没用条件给一堆。。。View Code #include <iostream>#include <map>#include <string>#include <algorithm>using namespace std;typedef struct L{ int start,during;}L;L phone[11000];int main(){ int n,m,i,j; int start,during; int ans; while(s 阅读全文
posted @ 2012-05-10 18:05 LegendaryAC 阅读(256) 评论(0) 推荐(0)
HDU 2140 Michael Scofield's letter
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2140按题意翻译字符串View Code #include <stdio.h>#include <string.h>int main(){ char tab[10][2]={{'b',' '},{'q',','},{'t','!'},{'m','l'},{'i','e'},{'c','a'},{& 阅读全文
posted @ 2012-04-26 18:09 LegendaryAC 阅读(255) 评论(0) 推荐(0)
HDU 1339 A Simple Task
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1339n=o*2^p,已知n,求o和p水、、、View Code #include <stdio.h>#include <string.h>int main(){ int t,n; int cnt; scanf("%d",&t); while(t--) { scanf("%d",&n); if(n%2) printf("%d 0\n",n); else { cnt=0; ... 阅读全文
posted @ 2012-04-26 13:06 LegendaryAC 阅读(163) 评论(0) 推荐(0)
HDU 1391 Number Steps
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1391水View Code #include <stdio.h>#include <string.h>int main(){ int t; int x,y; scanf("%d",&t); while(t--) { scanf("%d%d",&x,&y); if(x!=y&&x!=y+2) puts("No Number"); else { if(y%2) ... 阅读全文
posted @ 2012-04-26 12:48 LegendaryAC 阅读(152) 评论(0) 推荐(0)
HDU 1491 Octorber 21st
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1491无聊题View Code #include <stdio.h>int main(){ int t,i; int month,day,now; int tab[11]={0,31,28,31,30,31,30,31,31,30}; scanf("%d",&t); while(t--) { scanf("%d%d",&month,&day); if(month>10||(month==10&&day>21 阅读全文
posted @ 2012-04-26 11:18 LegendaryAC 阅读(197) 评论(0) 推荐(0)
HDU 2103 Family planning
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2103bs这道题,我坚信生男生女都一样!ps:不提前把几个0打出来的话要用__int64,否则会超范围View Code #include <stdio.h>int main(){ int t,m,n; int i; int bb,cnt,f; __int64 ans,fj; scanf("%d",&t); while(t--) { cnt=ans=f=0; fj=10000; scanf("%d%d",&m,&n); ... 阅读全文
posted @ 2012-04-24 20:57 LegendaryAC 阅读(234) 评论(0) 推荐(0)
HDU 2719 The Seven Percent Solution
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2719按要求处理字符串View Code #include <stdio.h>#include <string.h>int main(){ char s[1100]; char tab1[30]={' ','!','$','%','(',')','*'}; char tab2[10][20]={{"%20"},{"%21"},{&quo 阅读全文
posted @ 2012-04-23 22:35 LegendaryAC 阅读(203) 评论(0) 推荐(0)
HDU 2743 Quicksum
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2734按规则计算就行,很简单、、、View Code #include <stdio.h>#include <string.h>int main(){ char s[1100]; char tab[30]={' ','A','B','C','D','E','F','G','H','I','J','K 阅读全文
posted @ 2012-04-23 22:24 LegendaryAC 阅读(203) 评论(0) 推荐(0)
HDU 2700 Parity
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2700读懂了发现就是一个奇偶判断View Code #include <stdio.h>#include <string.h>int main(){ char s[1100]; int len,cnt,i; while(gets(s)) { cnt=0; if(s[0]=='#')break; len=strlen(s); for(i=0;i<len-1;i++) if(s[i]=='1')cnt++; ... 阅读全文
posted @ 2012-04-23 22:15 LegendaryAC 阅读(235) 评论(0) 推荐(0)
HDU 1163 Eddy's digital Roots
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1163脑袋疼的厉害,写完没调试直接交,居然把%d写成%c,导致wa一次。。。这题感觉前两天刚做过一道一样的。。。HDOJ的题目很多无脑重复啊。。View Code #include <stdio.h>int main(){ int n; int i,s; while(scanf("%d",&n),n) { s=1; for(i=0;i<n;i++) s=s*n%9; if(s==0) printf("... 阅读全文
posted @ 2012-04-22 16:29 LegendaryAC 阅读(175) 评论(0) 推荐(0)
HDU 4147 KFC -Z+W
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4147小学生英文阅读题View Code #include <stdio.h>#include <string.h>#include <stdlib.h>#define INF 100000000int main(){ int n,B,D,f,F; int sum,min,len; int i,j; char s[1100]; while(~scanf("%d%d%d%d%d%*c",&n,&B,&D,&f,&F) 阅读全文
posted @ 2012-04-21 16:25 LegendaryAC 阅读(257) 评论(0) 推荐(0)
HDU 1326 Box of Bricks
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1326水,不过PE两次,囧View Code #include <stdio.h>#include <stdlib.h>int cmp(const void*a,const void*b){ return *(int*)b-*(int*)a;}int main(){ int n,i,s,av,bz; int h[60]; int nCase=1; while(scanf("%d",&n),n) { s=bz=0; for(i=0;i<n;i++)... 阅读全文
posted @ 2012-04-21 14:26 LegendaryAC 阅读(239) 评论(0) 推荐(0)
HDU 1718 Rank
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1718求给定学号在所有人里面的排名View Code #include <stdio.h>int main(){ int gd; int a[1100],b[1100]; int i; while(~scanf("%d",&gd)) { int cnt=0; while(scanf("%d%d",a+cnt,b+cnt),(a[cnt]||b[cnt])) cnt++; for(i=0;i<cnt;i++) ... 阅读全文
posted @ 2012-04-19 17:12 LegendaryAC 阅读(207) 评论(0) 推荐(0)
HDU 2148 Score
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2148View Code #include <stdio.h>#include <string.h>#include <math.h>#include <stdlib.h>int main(){ int t,n,l; int i; int s[1100]; scanf("%d",&t); while(t--) { scanf("%d%d",&n,&l); for(i=1;i<=n;i++) s 阅读全文
posted @ 2012-04-19 16:07 LegendaryAC 阅读(155) 评论(0) 推荐(0)
HDU 2192 MagicBuilding
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2192求出现的最多的那个数字出现的次数参考祖宗的方法搞的,排序+扫。View Code #include <stdio.h>#include <string.h>#include <stdlib.h>int cmp(const void*a,const void*b){ return *(int*)a-*(int*)b;}int a[11000];int main(){ int t,n,i; int s,ans; scanf("%d",&t); 阅读全文
posted @ 2012-04-19 15:39 LegendaryAC 阅读(204) 评论(0) 推荐(0)
HDU 1673 Optimal Parking
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1673阅读题View Code #include <stdio.h>#include <stdlib.h>int cmp(const void*a,const void*b){ return *(int*)a-*(int*)b;}int main(){ int t,n,i; int x[30]; scanf("%d",&t); while(t--) { scanf("%d",&n); for(i=0;i<n;i++) sca 阅读全文
posted @ 2012-04-18 21:29 LegendaryAC 阅读(272) 评论(0) 推荐(0)