11062 - Andy's Second Dictionary

All about problems in Volume 110. If there is a thread about your problem, please use it. If not, create one with its number in the subject.

Moderator: Board moderators

jan_holmes
Experienced poster
Posts: 136
Joined: Fri Apr 15, 2005 3:47 pm
Location: Singapore
Contact:

11062 - Andy's Second Dictionary

Post by jan_holmes » Sun Aug 06, 2006 9:53 am

What is the output of :
Adv- enture- s
of
disney-154323 land
in Ja-
pan."-

".
Thx... :)

StatujaLeha
Learning poster
Posts: 91
Joined: Tue May 31, 2005 2:01 pm
Location: Russia

Post by StatujaLeha » Sun Aug 06, 2006 10:28 am

my accepted program produces
adventures
disney
in
japan
land
of

jan_holmes
Experienced poster
Posts: 136
Joined: Fri Apr 15, 2005 3:47 pm
Location: Singapore
Contact:

Post by jan_holmes » Sun Aug 06, 2006 10:53 am

Thx StatujaLeha... I'll try to fix my program now... :D

User avatar
little joey
Guru
Posts: 1080
Joined: Thu Dec 19, 2002 7:37 pm

Post by little joey » Sun Aug 06, 2006 11:26 am

StatujaLeha wrote:my accepted program produces
adventures
disney
in
japan
land
of
Well, if your accepted program produces that output, then the judges' input is too weak, because the correct output is

Code: Select all

adv-
disney-
enture-
in
japan
land
of
s
From the problem statement:
The hyphen character is part of the word if, and only if, not followed by a newline.

User avatar
sohel
Guru
Posts: 856
Joined: Thu Jan 30, 2003 5:50 am
Location: New York

Post by sohel » Sun Aug 06, 2006 3:49 pm

Indeed, the judge's data is too weak.

My program outputs.

Code: Select all

adv
disney
enture
in
japan
land
of
s
During the contest, i assumed if a word is hyphenated and is not followed by another alphabet, then that hyphen isn't part of the word.

But looking at Little Joey's post, I guess i was wrong... :D

Good that the judge data was shallow... :wink:
otherwise it would have taken more than 1 submission to get AC.

User avatar
mute
New poster
Posts: 8
Joined: Thu Apr 13, 2006 2:16 am
Location: Dhaka
Contact:

Post by mute » Mon Aug 07, 2006 10:30 pm

My code outputs

Code: Select all

adv-
disney-
enture-
in
japan
land
of
s 
I am confused??
:-? :roll:
If the input is what will be the output

Code: Select all

disney-
-enture-
- in
   japan
land
of
and if any one can plz send any input than I can test
Check this out ThirdEye Creative.com
Image

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Post by Martin Macko » Tue Aug 08, 2006 5:46 am

mute wrote:My code outputs

Code: Select all

adv-
disney-
enture-
in
japan
land
of
s 
I am confused??
Yes, this the most correct output. Read little joey's post.
mute wrote: :-? :roll:
If the input is what will be the output

Code: Select all

disney-
-enture-
- in
   japan
land
of
The correct output is:

Code: Select all

disney-enture-
in
japan
land
of
mute wrote:and if any one can plz send any input than I can test
Try this one:

Code: Select all

A-
--
-

B--
--

C--
 --
--
My output is as follows:

Code: Select all

--
a-
b--
c-

User avatar
mute
New poster
Posts: 8
Joined: Thu Apr 13, 2006 2:16 am
Location: Dhaka
Contact:

Post by mute » Tue Aug 08, 2006 3:12 pm

Thnx Martin

Code: Select all

adv
-disney-
enture-
in
-japan
land
of
s
For this Input my code generate

Code: Select all

advdisneyentureinjapan
land
of
s
is it correct?
Check this out ThirdEye Creative.com
Image

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Post by Martin Macko » Tue Aug 08, 2006 4:18 pm

mute wrote:Thnx Martin

Code: Select all

adv
-disney-
enture-
in
-japan
land
of
s
According to the problem statement the correct output is as follows:

Code: Select all

-disneyenturein
-japan
adv
land
of
s
As
Problem statement wrote:The hyphen character is part of the word if, and only if, not followed by a newline.

User avatar
mute
New poster
Posts: 8
Joined: Thu Apr 13, 2006 2:16 am
Location: Dhaka
Contact:

Post by mute » Wed Aug 09, 2006 9:44 am

Thanks Martin,
When a word is hyphenated, its prefix initiates on a line, followed by hyphen character, maybe followed by a newline, followed by the rest of the word. The rest of the word may be itself hyphenated.
I actually misunderstood red marked sentence

Thanks again
Check this out ThirdEye Creative.com
Image

User avatar
willima
New poster
Posts: 13
Joined: Wed Dec 07, 2005 1:19 pm
Location: Brazil

How to stop reading

Post by willima » Thu Aug 10, 2006 8:00 pm

Why this code below makes TLE??

while ( !cin.eof() )
{
//...my code...
}

Bye bye,
Willian
"Don't let the day go by
Don't let it end
Don't let the day go by, in doubts
The anwser lis within"

User avatar
willima
New poster
Posts: 13
Joined: Wed Dec 07, 2005 1:19 pm
Location: Brazil

Mistake founded!

Post by willima » Thu Aug 10, 2006 9:26 pm

Plesar, don't take in account my last post, because I've already founded my mistake: inside the loop, there was a command cin.getline( atual, MAXL ); And MAXL didn't have size enough to get the EOF sinal in the last line :oops:

So, that was what was going wrong, and I fixed it and got AC.

Goodbye everybody!!!
"Don't let the day go by
Don't let it end
Don't let the day go by, in doubts
The anwser lis within"

User avatar
cytmike
Learning poster
Posts: 95
Joined: Mon Apr 26, 2004 1:23 pm
Location: Hong Kong and United States
Contact:

Post by cytmike » Fri Aug 11, 2006 1:13 am

Can anybody post some more test cases? I get above ones correct but still WA. :evil:

Here's my code if you want to take a look.

Code: Select all

AC
:D
Last edited by cytmike on Fri Aug 11, 2006 3:02 pm, edited 1 time in total.
Impossible is Nothing.

User avatar
willima
New poster
Posts: 13
Joined: Wed Dec 07, 2005 1:19 pm
Location: Brazil

More case tests

Post by willima » Fri Aug 11, 2006 1:21 am

Here are more 1 case test:

Input:

Adv-
ent-
ures
in
Dis-
ney-
land

Two blondes were go-
ing to Disney-land
when they came to a
fork in the road.
The sign read: "Dis-
neyland Left."

So they went home.

This is takin' so so so, lo-
ng!!!!!!!!
Why??????


What is t-
hat little-guy!!!

will-lima@pop.com.br

pe-
er-2-peer!!

I have a 22 years oLd GUY insIde me at tHIs moment!!!

Andy is now 9-
year old and is getting ambitious.

Sub-
concious mind. Dre-
am-Theater-Scenes!

tes-
-1


Ouput by my AC code:

a
adventures
ambitious
and
andy
at
blondes
br
came
com
disney-land
disneyland
dream-theater-scenes
fork
getting
going
guy
have
home
i
in
inside
is
left
little-guy
long
me
mind
moment
now
old
peer-
pop
read
road
sign
so
subconcious
takin
that
the
they
this
to
two
went
were
what
when
why
will-lima
year
years


See ya!
"Don't let the day go by
Don't let it end
Don't let the day go by, in doubts
The anwser lis within"

User avatar
Martin Macko
A great helper
Posts: 481
Joined: Sun Jun 19, 2005 1:18 am
Location: European Union (Slovak Republic)

Re: More case tests

Post by Martin Macko » Fri Aug 11, 2006 8:35 am

willima wrote:Here are more 1 case test:
In addition to your output my AC wrote two words more:
-peer
a
adventures
ambitious
and
andy
at
blondes
br
came
com
disney-land
disneyland
dream-theater-scenes
fork
getting
going
guy
have
home
i
in
inside
is
left
little-guy
long
me
mind
moment
now
old
peer-
pop
read
road
sign
so
subconcious
takin
tes-
that
the
they
this
to
two
went
were
what
when
why
will-lima
year
years
The word "-peer" is there from:
...
pe-
er-2-peer!!
...
and the word "tes-" is there from:
...
tes-
-1

Post Reply

Return to “Volume 110 (11000-11099)”