SPOJ Problem Set (classical)2523. MispellingProblem code: GNY07A |
Misspelling is an art form that students seem to excel at. Write a program that removes the nth character from an input string.
Input
The first line of input contains a single integer N (1 ≤ N ≤ 1000) which is the number of datasets that follow.
Each dataset consists of a single line of input containing M, a space, and a string made up of uppercase letters and spaces only. M will be less than or equal to the length of the string. The length of the string is guaranteed to be less than or equal to 80.
Output
For each dataset, you should generate one line of output with the following values: The dataset number as a decimal integer (start counting at one), a space, and the misspelled string. The misspelled string is the input string with the indicated character deleted.
Sample Input
4 4 MISSPELL 1 PROGRAMMING 7 CONTEST 3 BALLOON
Sample Output
1 MISPELL 2 ROGRAMMING 3 CONTES 4 BALOON
All Submissions
Best Solutions
Point Value: 3
Time Limit: 2.00s
Memory Limit: 16M
Added: Apr 08, 2011
Languages Allowed:
C++03, PAS, C, HASK, ASM, RUBY, PYTH2, JAVA, PHP, SCM, CAML, PERL, C#, C++11, PYTH3
Comments (Search)
I've fixed the test data and rejudged your submission, which now gets AC.
2. Here, "decimal" refers to the numerical base--contrast with octal, or hexadecimal. Decimal means base 10, so just use the normal numbers you're familiar with.
10
4 MISSPELL
1 PROGRAMMING ASDF
7 CONTEST ASDF ASDF
3 BALLOON
11 HELLO BELLO HOWDY
5 WHAT IS THE
6 MEAINNIG BLABLA
15 BATMAN SUPERMAN
12 WOLOLOL LOLO
13 GOOAL A B C D
Output:
1 MISPELL
2 ROGRAMMING ASDF
3 CONTES ASDF ASDF
4 BALOON
5 HELLO BELL HOWDY
6 WHATIS THE
7 MEAINIG BLABLA
8 BATMAN SUPERMA
9 WOLOLOL LOL
10 GOOAL A B C
Sorry for beeing slow but I've read the problem quite a few times and tested it aswell, for example here is my test output, and I don't see what is wrong with it.
I've tried the cases you have mentioned. I think I'm getting the right output, though maybe the format is not good. Can you take a look at it?
My Input:
6
4 MISSPELL
1 P
3 EGY JETTO
7 CONTEST ASDF ASDF
3 BALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONO
1 W
Output:
1 MISPELL
2
3 EG JETTO
4 CONTES ASDF ASDF
5 BALOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONOBALLOONONO
6
Also, see this link and read the Important Note: http://wcipeg.com/wiki/Judge:Help#Guidelines_for_submitting
when the correct answer is:
You should also read these guidelines -- specifically, the important note.
See also this section of the wiki.
for which the output would be: