347 - Run

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

Moderator: Board moderators

uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: problem 347 WAAAA!!!!!!!

Post by uDebug »

well I don't know what happened on my code
I always got WA
but I can't find out where my problem is,format? Or something I miss?
I don't know
pls someone for help!!!!!
Looks like all you need to do is perhaps change Line #87 from

Code: Select all

 printf("case %d: ",cases);
to

Code: Select all

 printf("Case %d: ",cases);
The word "case" is spelled with a capital C - so

Case

Not

case
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: problem 347 WAAAA!!!!!!!

Post by uDebug »

Here's some input / output I found useful during testing / debugging.

Note that the time limit for this problem is 3 seconds. So be wary of the efficiency of your program.

Input:

Code: Select all

1111111
666666
555555
999999
888888
777777
10
248798
9000000
9000000
9000000
9000000
9000000
9000000
9000000
0
AC Output:

Code: Select all

Case 1: 1246895
Case 2: 734259
Case 3: 591342
Case 4: 1246895
Case 5: 895314
Case 6: 794253
Case 7: 13
Case 8: 253194
Case 9: 9415268
Case 10: 9415268
Case 11: 9415268
Case 12: 9415268
Case 13: 9415268
Case 14: 9415268
Case 15: 9415268
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.
bobSHIH
New poster
Posts: 4
Joined: Thu Feb 13, 2014 6:58 am

Re: problem 347 WAAAA!!!!!!!

Post by bobSHIH »

v1n1t wrote: Looks like all you need to do is perhaps change Line #87 from

Code: Select all

 printf("case %d: ",cases);
to

Code: Select all

 printf("Case %d: ",cases);
The word "case" is spelled with a capital C - so

Case

Not

case
ooooooh~
i cant believe i make a so stupid mistake
THANK YOU FOR YOUR HELP
:D

btw i got AC without TLE
uDebug
A great helper
Posts: 475
Joined: Tue Jul 24, 2012 4:23 pm

Re: problem 347 WAAAA!!!!!!!

Post by uDebug »

bobSHIH wrote:btw i got AC without TLE
Wonderful! Well done!
Check input and AC output for over 7,500 problems on uDebug!

Find us on Facebook. Follow us on Twitter.
matheusdallrosa
New poster
Posts: 11
Joined: Fri Nov 08, 2013 11:04 pm

Re: 347 - Run

Post by matheusdallrosa »

i don't know why i'm getting TLE, i tested with all numbers in 10...9999999 and no one of the tests became in infinite loop.

code:

Code: Select all

got AC
I don't know where is the performance problem. Please help-me?
Last edited by matheusdallrosa on Sat Jan 10, 2015 9:48 pm, edited 1 time in total.
lighted
Guru
Posts: 587
Joined: Wed Jun 11, 2014 9:56 pm
Location: Kyrgyzstan, Bishkek

Re: 347 - Run

Post by lighted »

Generate all run around numbers. Then for each query you can do binary or linear search.
A person who sees the good in things has good thoughts. And he who has good thoughts receives pleasure from life... Bediuzzaman
Post Reply

Return to “Volume 3 (300-399)”