11220 - Decoding the message.
Posted: Sun Jun 10, 2007 12:27 pm
what's wrong with my code?
please help me.
please help me.
Code: Select all
GOT AC
Code: Select all
GOT AC
Code: Select all
2
note the space after the last word of the next line
second line
Code: Select all
2
The first line of input gives the number of cases T one
less than or equals to T less than or equals to thirty
then there is a blank line before the first test
case Each test case represents a message which is composed
by one less than or equals to N less than or equals to
hundred lines and each line is composed by one to thirty
words
Code: Select all
Case #1:
Tinusr
lhusly
thaer
Case #2:
caseege
bnsnls
hidhoy
w
Code: Select all
ACCed - Dumb Mistake. Thanks.
Code: Select all
Code removed
Code: Select all
Case #1:
How
are
you
Case #2:
Fine
and
you
<--- \n
Code: Select all
Case #1:
How
are
you
Case #2:
Fine
and
you
Code: Select all
Remove after ac.
* change/add the following two lines!!linux wrote:Any idea? I'm getting frequent WA!!!!!!!!!!!!Code: Select all
#include<stdio.h> #include<ctype.h> main() { int n,i,l,nw,pos; char c,t; scanf("%d",&n); getchar(); getchar();// * ............... ............... if (i) putchar('\n'); printf("Case #%d:\n",i+1); // * add newline char .......................... ......................... }
Code: Select all
Changed
So, 30*30 = 900 letters and with some white spaces you have almost 1000 characters in a line. But you have only 109 characters. For safety take 2000 or more.each line is composed by 1 ≤ M ≤ 30 words. Two words in the same line are separated by one or more white spaces. A word is formed by the letters A-Z and a-z and has at most 30 letters