周赛二 简单题目汇总
来源:互联网 发布:mysql 引号转义 编辑:程序博客网 时间:2024/06/13 23:51
1、http://acm.hdu.edu.cn/showproblem.php?pid=2113
Secret Number
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 7369 Accepted Submission(s): 3124
Problem Description
有一天, KIKI 收到一张奇怪的信, 信上要KIKI 计算出给定数各个位上数字为偶数的和.
eg. 5548
结果为12 , 等于 4 + 8
KIKI 很苦恼. 想请你帮忙解决这个问题.
eg. 5548
结果为12 , 等于 4 + 8
KIKI 很苦恼. 想请你帮忙解决这个问题.
Input
输入数据有多组,每组占一行,只有一个数字,保证数字在INT范围内.
Output
对于每组输入数据,输出一行,每两组数据之间有一个空行.
Sample Input
4153263262
Sample Output
1210
Author
kiki
AC代码:
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;int main(){ int n,flag=0; while(scanf("%d",&n)!=EOF) { int k,sum=0; while(n) { int k=n%10; if(k%2==0) sum+=k; n/=10; } if(flag==0) { printf("%d\n",sum); flag=1; } else { printf("\n"); printf("%d\n",sum); } } return 0;}
2、http://acm.hdu.edu.cn/showproblem.php?pid=2115
题目:
I Love This Game
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 5247 Accepted Submission(s): 1810
Problem Description
Do you like playing basketball ? If you are , you may know the NBA Skills Challenge . It is the content of the basketball skills . It include several parts , such as passing , shooting , and so on. After completion of the content , the player who takes the shortest time will be the winner . Now give you their names and the time of finishing the competition , your task is to give out the rank of them ; please output their name and the rank, if they have the same time , the rank of them will be the same ,but you should output their names in lexicographic order.You may assume the names of the players are unique.
Is it a very simple problem for you? Please accept it in ten minutes.
Is it a very simple problem for you? Please accept it in ten minutes.
Input
This problem contains multiple test cases! Ease test case contain a n(1<=n<=10) shows the number of players,then n lines will be given. Each line will contain the name of player and the time(mm:ss) of their finish.The end of the input will be indicated by an integer value of zero.
Output
The output format is shown as sample below.
Please output the rank of all players, the output format is shown as sample below;
Output a blank line between two cases.
Please output the rank of all players, the output format is shown as sample below;
Output a blank line between two cases.
Sample Input
10Iverson 17:19Bryant 07:03Nash 09:33Wade 07:03Davies 11:13Carter 14:28Jordan 29:34James 20:48Parker 24:49Kidd 26:460
Sample Output
Case #1Bryant 1Wade 1Nash 3Davies 4Carter 5Iverson 6James 7Parker 8Kidd 9Jordan 10
Author
為傑沉倫
Source
HDU 2007-10 Programming Contest_WarmUp
Recommend
威士忌
Ac代码:
#include<stdio.h>#include<iostream>#include<string.h>#include<algorithm>using namespace std;#define N 15struct node{ string name; int h; int m; int r;}a[N];int cmp(node b,node c){ if(b.h==c.h && b.m==c.m) return b.name<c.name; if(b.h==c.h) return b.m<c.m; return b.h<c.h;}int main(){ int n,cas=0; char ch; while(scanf("%d",&n)!=EOF) { if(n==0) break; cas++; if(cas!=1) { printf("\n"); } for(int i=1;i<=n;i++) { cin>>a[i].name>>a[i].h>>ch>>a[i].m; //scanf("%s%d:%d",a[i].name,&a[i].h,&a[i].m); } sort(a+1,a+n+1,cmp); printf("Case #%d\n",cas); //printf("%s 1\n",a[1].name); cout<<a[1].name<<" "<<1<<endl;// a[1].r=1; int m=1; for(int i=2;i<=n;i++) { if(a[i].h==a[i-1].h && a[i].m==a[i-1].m) { //printf("%s %d\n",a[i].name,a[i-1].r); cout<<a[i].name<<" "<<m<<endl; //a[i].r=a[i-1].r; } else { //printf("s %d\n",a[i].name,i); cout<<a[i].name<<" "<<i<<endl; m=i; } } } return 0;}/*5ab 00:00a 01:00b 01:00abc 01:10aa 01:10*/
3、http://acm.hdu.edu.cn/showproblem.php?pid=2117
Just a Numble
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 2072 Accepted Submission(s): 968
Problem Description
Now give you two integers n m, you just tell me the m-th number after radix point in 1/n,for example n=4,the first numble after point is 2,the second is 5,and all 0 followed
Input
Each line of input will contain a pair of integers for n and m(1<=n<=10^7,1<=m<=10^5)
Output
For each line of input, your program should print a numble on a line,according to the above rules
Sample Input
4 25 7123 123
Sample Output
508
Author
YBB
Source
HDU 2007-10 Programming Contest_WarmUp
Recommend
威士忌
Ac代码:
#include<stdio.h>#include<string.h>#include<algorithm>using namespace std;int main(){ int n,m; while(scanf("%d%d",&n,&m)!=EOF) { int k=1,j=0,sum=1; for(int i=1;i<=m+1;i++) { k=sum/n; j=sum%n; sum=j*10; } printf("%d\n",k); } return 0;}
0 0
- 周赛二 简单题目汇总
- 数位dp简单题目汇总
- 题目汇总
- 题目汇总
- 题目汇总
- leetcode题解-Dynamic Programming简单类别题目汇总
- 2005高考作文题目汇总
- Java笔试题目汇总
- C/C++ 题目汇总
- .net面试题目汇总
- java面试题目汇总
- Java面试题目汇总
- JAVA经典题目汇总
- C++题目汇总
- 笔试题目汇总
- 中兴笔试题目汇总
- C/C++题目汇总
- 海量数据处理题目汇总
- OpenGL常见问题
- Cocos2dx之定时器schedule,scheduleUpdate,scheduleOnce的使用
- hdu1241Oil Deposits 深广搜
- _00005 Hadoop DataNode源码浅析(RPC是基础)
- 那些年,我读过的技术书(Java下篇)
- 周赛二 简单题目汇总
- hdu 2058(水)
- OpenGL的函数(GLU, GLUT)
- jarsigner从jdk中截取出来单独(为程序签名)
- My First Blog
- hdu4768 二分
- Eclipse启动SDK Manager报错:[SDK Manager] 'xcopy' 不是内部或外部命令,也不是可运行的程序。
- git cannot work in windows cmd shell : try git-credential-winstore
- java逻辑运算符位运算符总结