10009 - All Roads Lead Where?

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

Moderator: Board moderators

@ce
Learning poster
Posts: 71
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: 10009 - All Roads Lead Where?

Post by @ce »

@brianfry713....Doesn't help...still RE...
I have submitted most of my questions in C++ without return 0. Its mandatory in C but not in C++, thats not the reason for RE in this case.
-@ce

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10009 - All Roads Lead Where?

Post by brianfry713 »

Maybe there are more than 30 cities.
Check input and AC output for thousands of problems on uDebug!

@ce
Learning poster
Posts: 71
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: 10009 - All Roads Lead Where?

Post by @ce »

@brianfry713, the question states
A city name consists of one or more letters, the first of which is in uppercase. No two cities begin with the same letter.
So, there can be maximum 26 cities.
-@ce

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10009 - All Roads Lead Where?

Post by brianfry713 »

line 55 should be
b = m.find(str2)->second;
instead of
a = m.find(str2)->second;
Check input and AC output for thousands of problems on uDebug!

@ce
Learning poster
Posts: 71
Joined: Mon May 28, 2012 8:46 am
Location: Ranchi, India

Re: 10009 - All Roads Lead Where?

Post by @ce »

Thanks brianfry713...I got AC.
-@ce

Labib
New poster
Posts: 12
Joined: Tue Mar 05, 2013 4:49 pm

Re: 10009 - All Roads Lead Where?

Post by Labib »

i dunno for what reason my mapped values change..
eg in the test case :
1
6 1
Rome BUET
BUET TSC
TSC Shahbag
Sahbag Nilkhet
Nilkhet Katabon
Katabon ElephantRoad
ElepehantRoad Rome

mapped value of ElepehantRoad should be 7.
but it changes to 0 when queried.

can anyone tell me what I should do?
thnx in advance.

Code: Select all

AC
Last edited by Labib on Fri Mar 08, 2013 1:32 pm, edited 1 time in total.

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10009 - All Roads Lead Where?

Post by brianfry713 »

You changed the spelling
ElephantRoad
ElepehantRoad
Check input and AC output for thousands of problems on uDebug!

Labib
New poster
Posts: 12
Joined: Tue Mar 05, 2013 4:49 pm

Re: 10009 - All Roads Lead Where?

Post by Labib »

testcase was from an earlier post... has problems
but the main code still WA :( @brainfry

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10009 - All Roads Lead Where?

Post by brianfry713 »

That is AC code.
Check input and AC output for thousands of problems on uDebug!

Labib
New poster
Posts: 12
Joined: Tue Mar 05, 2013 4:49 pm

Re: 10009 - All Roads Lead Where?

Post by Labib »

that's rilly weird
but thanks anyway brainfry! :)

Loading...
New poster
Posts: 6
Joined: Fri Jun 21, 2013 3:31 am

Re: 10009 - All Roads Lead Where?

Post by Loading... »

please give me critical test case , that i could find the bug in my code .
Thanks in advance .

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10009 - All Roads Lead Where?

Post by brianfry713 »

Try the I/O in this thread.
Check input and AC output for thousands of problems on uDebug!

kimbbakar
New poster
Posts: 5
Joined: Wed Nov 13, 2013 8:48 am

Re: 10009 - All Roads Lead Where?

Post by kimbbakar »

problem link: http://ideone.com/y8wRUO

Can anyone give me some test case?

brianfry713
Guru
Posts: 5947
Joined: Thu Sep 01, 2011 9:09 am
Location: San Jose, CA, USA

Re: 10009 - All Roads Lead Where?

Post by brianfry713 »

Don't print a blank line at the start of the output.
Check input and AC output for thousands of problems on uDebug!

kimbbakar
New poster
Posts: 5
Joined: Wed Nov 13, 2013 8:48 am

Re: 10009 - All Roads Lead Where?

Post by kimbbakar »

Thank you so much bro :D

Post Reply

Return to “Volume 100 (10000-10099)”