11220 - Decoding the message.

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

11220 - Decoding the message.

Post by hamedv »

what's wrong with my code?
please help me.

Code: Select all

GOT AC
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 »

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 »

Thank, I got AC

asmaamagdi
New poster
Posts: 27
Joined: Tue Dec 20, 2005 9:14 am
Location: Egypt

Post by asmaamagdi »

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 »

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:

Presentation Error in Java

Post by Jemerson »

Presentation Error!!
If anyone can help me to find my mistake I'll appreciate it a lot and be very thankful.

Code: Select all

ACCed - Dumb Mistake. Thanks.
Last edited by Jemerson on Tue Jun 19, 2007 6:03 pm, edited 1 time in total.
UFCG Brazil - Computer Science graduate student
http://acm.uva.es/problemset/usersnew.php?user=54806 ... and going up!

Darko
Guru
Posts: 580
Joined: Fri Nov 11, 2005 9:34 am
Location: Calgary, Canada

Post by Darko »

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> »

Hi,

This code segment gives run time error. Can some one please help me to locate my errors.

Code: Select all

Code removed
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 »

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

sample output of AC

Post by adelar »

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> »

Hi all,

Code: Select all

Remove after ac.
ABDULLAH.
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:

11220

Post by linux »

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

Re: 11220

Post by A1 »

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 »

Code: Select all

Changed
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 »

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.
Ami ekhono shopno dekhi...
HomePage

Post Reply

Return to “Volume 112 (11200-11299)”