随笔分类 -  无聊题

 
HDU 1209
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1209水题,按五个时针分针成的锐角从小到大排序,角度相同时间从早到晚,输出中间的那个时针一小时走30度,一分钟走0.5度,分针一分钟走6度,注意是锐角,大于180要用360减回去,为避免精度出问题统一乘2拒绝小数#... 阅读全文
posted @ 2015-02-03 00:39 LegendaryAC 阅读(174) 评论(0) 推荐(0)
HDU 2273
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2273N辆车排队过马路,不能相撞,问最短时间ans=车的总长度/最小速度#include using namespace std ;int main(){ int n ; while(~scanf("%d",&n)) { int minn=10 ; int a,b ; int cnt=0 ; while(n--) { scanf("%d%d",&a,&b) ; cnt+=a ; ... 阅读全文
posted @ 2013-12-07 00:56 LegendaryAC 阅读(210) 评论(0) 推荐(0)
HDU 1328 IBM Minus One
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1328最近发生了好多事,一言难尽。水一道。View Code #include <stdio.h>int main(){ int t ; scanf("%d",&t) ; for(int cas=1;cas<=t;cas++) { char str[51] ; scanf("%s",str) ; printf("String #%d\n",cas) ; for(int i=0;str[i];i++) if(s... 阅读全文
posted @ 2012-06-24 22:59 LegendaryAC 阅读(229) 评论(0) 推荐(0)
HDU 3293 sort
摘要: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 阅读(178) 评论(0) 推荐(0)
HDU 2401 Baskets of Gold Coins
摘要: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 阅读(217) 评论(0) 推荐(0)
HDU 2714 ISBN
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2714水,按要求找到符合要求的解。。View Code #include <iostream>using namespace std ;int main(){ char str[30] ; int i ; while(~scanf("%s",str)) { int cnt=0 ; int pos ; for(i=0;str[i];i++) if(str[i]=='X') cnt+=10 ; ... 阅读全文
posted @ 2012-06-13 21:00 LegendaryAC 阅读(199) 评论(0) 推荐(0)
HDU 3787 A+B
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3787水View Code #include <iostream>using namespace std ;int pow(int a,int b){ int s=1 ; for(int i=0;i<b;i++) s*=a ; return s ;}int main(){ char a[30],b[30] ; int a1,b1 ; while(~scanf("%s%s",a,b)) { int cnt=0 ; a1=b1=0... 阅读全文
posted @ 2012-06-11 21:41 LegendaryAC 阅读(167) 评论(0) 推荐(0)
HDU 1039 Easier Done Than Said?
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1039做一道水题收拾收拾睡了。今天hut校赛被虐成狗哇哈哈哈,被人虐好爽,各种高潮。暑假前要复习期末考试,还有字符串,搜索,计算几何,线段树这么一大堆东西要弄,真是令人充满干劲啊,burning!View Code #include <stdio.h>#include <string.h>int main (){ char str[101]; char tab[5]={'a','e','i','o','u' 阅读全文
posted @ 2012-06-03 22:45 LegendaryAC 阅读(162) 评论(0) 推荐(0)
HDU 1194 Beat the Spread!
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1194跟着狗畅找了道水题做,他真无聊啊。。。View Code #include <iostream>using namespace std ;int main(){ int n,i; int s,d; scanf("%d",&n); while(n--) { scanf("%d%d",&s,&d); for(i=s;i>0;i--) if(abs(i*2-s)==d) { pr... 阅读全文
posted @ 2012-06-02 17:55 LegendaryAC 阅读(250) 评论(0) 推荐(0)
HDU 1563 Find your present!
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1563找只出现一次的数,排个序处理下就行View Code #include <iostream>#include <algorithm>using namespace std ;int main(){ int n; while(scanf("%d",&n),n) { int a[201]; a[1]=a[n+1]=-1; for(int i=1;i<=n;i++) scanf("%d",&a[i]); sort(... 阅读全文
posted @ 2012-05-31 23:51 LegendaryAC 阅读(203) 评论(0) 推荐(0)
HDU 3279 Nth Largest Value
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=3279无聊题。。。View Code #include <iostream>#include <algorithm>using namespace std ;int main(){ int p; scanf("%d",&p); while(p--) { int cas; scanf("%d",&cas); int a[10]; for(int i=0;i<10;i++) scanf("%d",&a 阅读全文
posted @ 2012-05-31 13:07 LegendaryAC 阅读(189) 评论(0) 推荐(0)
HDU 2304 Electrical Outlets
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2304一个插头,n个插线板,问最后剩几个能插的电器的View Code #include <iostream>using namespace std ;int main(){ int n; scanf("%d",&n); while(n--) { int k; scanf("%d",&k); int s=0; for(int i=0;i<k;i++) { int w; sc... 阅读全文
posted @ 2012-05-31 12:39 LegendaryAC 阅读(206) 评论(0) 推荐(0)
HDU 2716 Message Decowding
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2716水题View Code #include <iostream>using namespace std ;int main(){ char key[27],mes[81] ; while(~scanf("%s%*c",key)) { gets(mes) ; for(int i=0;mes[i];i++) { if(mes[i]>='A'&&mes[i]<='Z') putchar(key[mes... 阅读全文
posted @ 2012-05-31 11:22 LegendaryAC 阅读(153) 评论(0) 推荐(0)
HDU 2154 跳舞毯
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2154无聊题。。。View Code #include <stdio.h>#include <stdlib.h> #include <string.h>const int mod=10000;int a[1001],b[1001],c[1001];int main(){ int n; while(scanf("%d",&n),n) { a[0]=1;b[0]=c[0]=0; for(int i=1;i<=n;i++) { a[i... 阅读全文
posted @ 2012-05-28 00:50 LegendaryAC 阅读(251) 评论(0) 推荐(0)
HDU 2539 点球大战
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2539无聊题,可能会有人名开头小写的数据,所以一定要倒着找no,我这种写法是中间出了点故障,导致写的很麻烦,不足取View Code #include <iostream>#include <string>using namespace std ;int main(){ int n; while(scanf("%d%*c",&n),n) { int flag1[10],flag2[10]; char str[101]; int ans1=0,ans2... 阅读全文
posted @ 2012-05-27 16:17 LegendaryAC 阅读(288) 评论(0) 推荐(0)
HDU 1982 Kaitou Kid - The Phantom Thief (1)
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1982字符串处理View Code #include <iostream>#include <string>using namespace std ;char str[27]={"ABCDEFGHIJKLMNOPQRSTUVWXYZ"};int main(){ int t; scanf("%d%*c",&t); while(t--) { string s; cin >> s ; for(int i=0;i<s.lengt 阅读全文
posted @ 2012-05-27 10:04 LegendaryAC 阅读(194) 评论(0) 推荐(0)
HDU 1976 Software Version
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1976水题View Code #include <stdio.h>#include <string.h>int main(){ int t; int a1,a2,a3; int b1,b2,b3; scanf("%d",&t); while(t--) { scanf("%d%d%d",&a1,&a2,&a3); scanf("%d%d%d",&b1,&b2,&b3); i 阅读全文
posted @ 2012-05-26 22:49 LegendaryAC 阅读(174) 评论(0) 推荐(0)
HDU 2368 Alfredo's Pizza Restaurant
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=2368初中数学题,圆幂定理View Code #include <iostream>using namespace std ;int main(){ double r,w,l; int nCase=1; while(scanf("%lf",&r),r) { scanf("%lf%lf",&w,&l); if(r*r-(w/2)*(w/2)<(l/2)*(l/2)) printf("Pizza %d does not f 阅读全文
posted @ 2012-05-25 12:55 LegendaryAC 阅读(173) 评论(0) 推荐(0)
HDU 1984 Mispelling4
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1984字符串处理View Code #include <iostream>#include <string>using namespace std;int main(){ int t,n; char str[110]; scanf("%d",&t); for(int cas=1;cas<=t;cas++) { scanf("%d %s",&n,str); str[n-1]='\0'; printf(" 阅读全文
posted @ 2012-05-25 06:22 LegendaryAC 阅读(170) 评论(0) 推荐(0)
HDU 1985 Conversions
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1985小学计算题View Code #include <iostream>#include <string>using namespace std;int main(){ int t; scanf("%d",&t); for(int cas=1;cas<=t;cas++) { double n; string d; cin >> n >> d; if(d=="kg") printf("%d %.4l 阅读全文
posted @ 2012-05-25 05:08 LegendaryAC 阅读(235) 评论(0) 推荐(0)