HDU 1982:Kaitou Kid - The Phantom Thief (1)
来源:互联网 发布:身份证找回淘宝店铺 编辑:程序博客网 时间:2024/06/06 19:13
传送门:http://acm.hdu.edu.cn/showproblem.php?pid=1982
Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Problem Description
Do you know Kaitou Kid? In the legend, Kaitou Kid is a master of disguise, and can take on the voice and form of anyone. He is not an evil person, but he is on the wrong side of the law. He's the very elusive phantom thief who never miss his prey although he always uses word puzzles to announce his targets before action.
【原题这里有张图,由于对题目没什么帮助就不传了【因为强迫症所以要强调一下
You are the leader of a museum. Recently, you get several priceless jewels and plan to hold an exhibition. But at the moment, you receive Kid's word puzzle... Fortunately, It seems Kid doesn’t want to trouble you, and his puzzle is very easy. Just a few minutes, You have found the way to solve the puzzle:
(1) change 1 to 'A', 2 TO 'B',..,26 TO 'Z'
(2) change '#' to a blank
(3) ignore the '-' symbol, it just used to separate the numbers in the puzzle
Input
The first line of the input contains an integer C which means the number of test cases. Then C lines follow. Each line is a sentence of Kid’s word puzzle which is consisted of '0' ~ '9' , '-' and '#'. The length of each sentence is no longer than 10000.
Output
For each case, output the translated text.
Sample Input
4
9#23-9-12-12#19-20-5-1-12#1-20#12-5-1-19-20#15-14-5#10-5-23-5-12
1-14-4#12-5-1-22-5#20-8-5#13-21-19-5-21-13#9-14#20#13-9-14-21-20-5-19
1-6-20-5-18#20-8-5#15-16-5-14-9-14-7#15-6#20-8-5#5-24-8-9-2-9-20-9-15-14
7-15-15-4#12-21-3-11
Sample Output
I WILL STEAL AT LEAST ONE JEWEL
AND LEAVE THE MUSEUM IN T MINUTES
AFTER THE OPENING OF THE EXHIBITION
GOOD LUCK
舒淇今天突然在他开的“CF 干死祂”讨论组(不!要!在!意!这!讨!论!组!的!名!字!)里叫我做这题,不明觉厉的我就去做了,昨晚之后我才问他做这题的意义是什么。。他没告诉我,只是在怨念他的代码为什么那么长还有居然提交了8次2333顺便这么水的题我居然交了两发因为第一次没考虑类似##########--------------########---------这样的会输出什么这对于很爱惜提交量的我简直。。QAQ渣渣就只有一道题交过8次。。【反正就是做了【顺便来凑一篇解题报告【这真的是解题报告么!【大概吧!2333
我的代码687MS,他的0MS!!!【我也不知道为什么。。难道是他在判断里多加了 i=i+1 ???【他一定不会介意我也把他代码贴上来的2333
思路?题目都说了啊2333又用不到算法,英语渣都能看懂题的程度
谁看出我程序为什么能跑那么久请务必告诉我。。渣渣看不出来QAQ
我的
#include<iostream>using namespace std;int main(){int c,i,num;char x[10010];//freopen("in.txt","r",stdin);scanf("%d",&c);while(c--){scanf("%s",x);num=0;for(i=0;i<strlen(x);i++){if(x[i]>='0' && x[i]<='9')num=num*10+x[i]-'0';else{if(num)printf("%c",'A'+num-1);num=0;if(x[i]=='#')printf(" ");}}if(num)printf("%c",'A'+num-1);printf("\n");}return 0;}
舒淇那货的
#include<iostream>#include<string>#include<fstream>using namespace std;char s[10010];int main(){ //ifstream in("asd.txt"); int i,n,a; cin>>n; while(n--) { cin>>s; a=strlen(s); for(i=0;i<a;i++) { if(s[i]>='0'&&s[i]<='9') { if(s[i+1]=='-'||s[i+1]=='\0') { s[i]=s[i]-'1'+'A'; cout<<s[i]; i=i+1; } else if(s[i+1]>='0'&&s[i+1]<='9') { s[i]=((s[i]-'0')*10 + s[i+1] -'1'+'A'); cout<<s[i]; i=i+1; } else { s[i]=s[i] + 'A' - '1'; cout<<s[i]; } } else if(s[i]=='#') cout<<" "; } cout<<endl; } return 0;}
- hdu 1982 Kaitou Kid - The Phantom Thief (1) (水。。)
- hdu 1982 Kaitou Kid - The Phantom Thief (1)
- hdu 1982——Kaitou Kid - The Phantom Thief (1)
- HDU 1982:Kaitou Kid - The Phantom Thief (1)
- HDU 1982 Kaitou Kid - The Phantom Thief (1)
- hdu 1982 Kaitou Kid - The Phantom Thief (1)
- Kaitou Kid - The Phantom Thief (1)
- hdoj-1982-Kaitou Kid - The Phantom Thief (1)
- HDU——1982Kaitou Kid - The Phantom Thief (1)(坑爹string题)
- HDOJ/HDU 1982 Kaitou Kid - The Phantom Thief (1)(字符串处理)
- hdu 1983 Kaitou Kid - The Phantom Thief (2) DFS + BFS
- hdu 1983 Kaitou Kid - The Phantom Thief (2) (DFS+BFS)
- HDU 1983 - Kaitou Kid - The Phantom Thief (2)
- HDU 1983 Kaitou Kid - The Phantom Thief (2)
- HDU 1983 Kaitou Kid - The Phantom Thief (2)
- hdu 1983 Kaitou Kid - The Phantom Thief (2)
- HDU 1983 Kaitou Kid - The Phantom Thief (2)
- hdu 1983 Kaitou Kid - The Phantom Thief (2)(bfs+dfs)
- Eclipse+Java+OpenCV249环境搭建和代码测试
- 解决X64操作系统PL/SQL连接报错问题 make sure you have the 32 bits oracle client installed
- hibernate manyToOne lazy to one Annotation
- PHP 文档学习 - 7 - namespace & exception
- 初探swift语言的学习笔记四-2(对上一节有些遗留进行处理)
- HDU 1982:Kaitou Kid - The Phantom Thief (1)
- -1.#IND,1.#INF 的判断
- 插值算法的一些,随时有可能更新
- 小说推荐1
- GetPrivateProfileStringA 函数
- excel
- 以多个实例方式打开Notepad++
- 3dsmax模型和导入模型到unity3d的一些心得
- 在类内部调用方法