10427 - Naughty Sleepy Boys

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

Moderator: Board moderators

yoshiro aoki
New poster
Posts: 21
Joined: Sat Oct 21, 2006 11:50 pm
Contact:

Post by yoshiro aoki »

hi, Im yoshiro.

sorry, my problem was I sent an old version of my program to the judge by accident.

The program that passed millions of test cases of course got AC. I enjoyed writing that test case generator : )!!

I posted several critical test cases for this program challenge here, but I don't see them here any more.

I will look again. If I find them I will post here.

have a good day,
-yoshiro (mark) aoki
yoshiro (mark) aoki
yoshiro aoki
New poster
Posts: 21
Joined: Sat Oct 21, 2006 11:50 pm
Contact:

Post by yoshiro aoki »

The test cases I posted were in my post right before yours.

I see that my message there has been cut away (removed).

Maybe my posting of that information was not allowed :(

Ok, from memory I can offer only small advice, and that is to be sure to write test cases to check border conditions.

Hope that helps. Now, I must get back to working :-P
yoshiro (mark) aoki
sazzadcsedu
Experienced poster
Posts: 136
Joined: Sat Nov 29, 2008 8:01 am
Location: narayangong,bangladesh.
Contact:

Re: 10427 - Naughty Sleepy Boys

Post by sazzadcsedu »

what is the exact input limit for this problem??

my solution works well for <100000000;

but does nt wrk more than that.

can anyone help???

here is my code.

is I/O format ok???

i got TLE;
but why??????

Code: Select all

removed after ACCepted.
Last edited by sazzadcsedu on Sun Mar 01, 2009 9:31 pm, edited 1 time in total.
Life is more complicated than algorithm.
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
mf
Guru
Posts: 1244
Joined: Mon Feb 28, 2005 4:51 am
Location: Zürich, Switzerland
Contact:

Re: 10427 - Naughty Sleepy Boys

Post by mf »

sazzadcsedu wrote:what is the exact input limit for this problem??
You can't read, or what?

The problem statement is very specific about what you should expect in the input:
http://acm.uva.es/p/v104/10427.html wrote:The input will contain one or more line each containing a positive integer N (N<100000000). Total line of the input file will not exceed 11000.
sazzadcsedu wrote:is I/O format ok???
Looks good to me.
sazzadcsedu wrote:i got TLE;
but why??????
Because your program can't solve 11000 test cases in under 3 seconds.

You need to solve each test case much faster, than with a loop with many millions of iterations.
sazzadcsedu
Experienced poster
Posts: 136
Joined: Sat Nov 29, 2008 8:01 am
Location: narayangong,bangladesh.
Contact:

10427 - Naughty Sleepy Boys

Post by sazzadcsedu »

LOts of people give input/output for num>=100000000.
which needn't to be cosidered because problem statement says
The input will contain one or more line each containing a positive integer N (N<100000000).
Life is more complicated than algorithm.
http://felix-halim.net/uva/hunting.php?id=32359
For Hints: http://salimsazzad.wordpress.com
plamplam
Experienced poster
Posts: 150
Joined: Fri May 06, 2011 11:37 am

Re: 10427 - Naughty Sleepy Boys

Post by plamplam »

You can simply solve this using brute force. May be there is a smarter way to get lower runtime but I am too lazy to figure it out as I got Accepted. My code got Accepted in 0.572(not a good runtime but whatever). Just use a character array to precalculate and print the N-th(or (N-1)-th, depending on what you use) index of the array.
You tried your best and you failed miserably. The lesson is 'never try'. -Homer Simpson
Post Reply

Return to “Volume 104 (10400-10499)”