All about problems in Volume 112. If there is a thread about your problem, please use it. If not, create one with its number in the subject.
Moderator: Board moderators
hamedv
Learning poster
Posts: 98 Joined: Mon May 07, 2007 8:30 am
Post
by hamedv » Sun Jun 10, 2007 12:27 pm
what's wrong with my code?
please help me.
Last edited by
hamedv on Sun Jun 10, 2007 5:33 pm, edited 1 time in total.
krijger
New poster
Posts: 39 Joined: Wed Jul 21, 2004 12:35 am
Post
by krijger » Sun Jun 10, 2007 1:06 pm
Try this:
Code: Select all
2
note the space after the last word of the next line
second line
hamedv
Learning poster
Posts: 98 Joined: Mon May 07, 2007 8:30 am
Post
by hamedv » Sun Jun 10, 2007 5:32 pm
Thank, I got AC
asmaamagdi
New poster
Posts: 27 Joined: Tue Dec 20, 2005 9:14 am
Location: Egypt
Post
by asmaamagdi » Mon Jun 11, 2007 3:34 am
My code is correct when there are spaces at the end of the line, but I'm still getting WA
Is there any other trick about it??!!
What if I entered 2 line feeds after the number of cases (or between 2 test cases)?
Should I print Case #: and 2 empty lines or should I wait for real data first??!!
Thnx in advance
ayeshapakhi
Learning poster
Posts: 60 Joined: Sun Apr 16, 2006 7:59 pm
Post
by ayeshapakhi » Tue Jun 12, 2007 9:02 pm
probably there's no such things..
try this
input
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
output
Code: Select all
Case #1:
Tinusr
lhusly
thaer
Case #2:
caseege
bnsnls
hidhoy
w
Jemerson
Learning poster
Posts: 59 Joined: Mon Feb 02, 2004 11:19 pm
Contact:
Post
by Jemerson » Mon Jun 18, 2007 9:49 pm
Presentation Error!!
If anyone can help me to find my mistake I'll appreciate it a lot and be very thankful.
Last edited by
Jemerson on Tue Jun 19, 2007 6:03 pm, edited 1 time in total.
Darko
Guru
Posts: 580 Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada
Post
by Darko » Tue Jun 19, 2007 12:50 am
You have a space at the end of that "Case #..." line.
abdullah<cse du>
New poster
Posts: 39 Joined: Mon Dec 04, 2006 2:18 pm
Location: Bangladesh(CSE DU)
Contact:
Post
by abdullah<cse du> » Mon Jun 25, 2007 4:07 am
Hi,
This code segment gives run time error. Can some one please help me to locate my errors.
ABDULLAH
Last edited by
abdullah<cse du> on Tue Jul 17, 2007 2:34 pm, edited 1 time in total.
We were in past, we are in past and we will go in past.
mf
Guru
Posts: 1244 Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:
Post
by mf » Mon Jun 25, 2007 4:32 am
Your code doesn't even pass the sample input/output.
It reads input in the wrong way.
adelar
New poster
Posts: 35 Joined: Wed May 02, 2007 11:48 pm
Location: Brasil
Post
by adelar » Mon Jul 02, 2007 2:13 pm
Hi,
the sample output of AC is:
Code: Select all
Case #1:
How
are
you
Case #2:
Fine
and
you
<--- \n
and don't:
Code: Select all
Case #1:
How
are
you
Case #2:
Fine
and
you
abdullah<cse du>
New poster
Posts: 39 Joined: Mon Dec 04, 2006 2:18 pm
Location: Bangladesh(CSE DU)
Contact:
Post
by abdullah<cse du> » Tue Jul 17, 2007 2:37 pm
Last edited by
abdullah<cse du> on Wed Jul 18, 2007 8:08 am, edited 1 time in total.
We were in past, we are in past and we will go in past.
linux
Learning poster
Posts: 56 Joined: Sat Jul 01, 2006 12:21 pm
Location: CA-95054
Contact:
Post
by linux » Tue Jul 17, 2007 3:37 pm
Code: Select all
Thanks for contribution! Got AC. :D
Last edited by
linux on Wed Jul 18, 2007 7:53 am, edited 2 times in total.
Solving for fun..
A1
Experienced poster
Posts: 173 Joined: Wed Jan 28, 2004 3:34 pm
Location: Bangladesh
Post
by A1 » Wed Jul 18, 2007 12:09 am
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
..........................
.........................
}
* change/add the following two lines!!
>> Interesting code..
lnr
Experienced poster
Posts: 142 Joined: Sat Jun 30, 2007 2:52 pm
Location: Dhaka,Bangladesh
Post
by lnr » Tue Sep 18, 2007 5:16 pm
Last edited by
lnr on Wed Sep 19, 2007 8:41 am, edited 1 time in total.
Jan
Guru
Posts: 1334 Joined: Wed Jun 22, 2005 10:58 pm
Location: Dhaka, Bangladesh
Contact:
Post
by Jan » Wed Sep 19, 2007 6:24 am
Read the description again...
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
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.
Hope it helps.