Page 1 of 1

1618 - Positions

Posted: Mon Feb 06, 2012 6:26 pm
by dovier

Re: 1618 - Positions

Posted: Fri Jul 20, 2012 2:09 am
by padrinoIJ
WHY???? Time limited exceeded for a simple problem,

Code: Select all

b = (a+b>=n) ?  n - a : b+1;
with this code i have received tle test 1, but my friend with this same code received AC months ago, lately the server is having problems... two short code solutions give me TLE, please, read this post and answer me, I am disenchanted with the system, .........

Re: 1618 - Positions

Posted: Thu Aug 02, 2012 7:01 pm
by JJRZ
I just did the same and I got an TLE, then I submited in C++ and I got an WA in the test 1... What am I doing wrong :?:
After thinking a little, this problem is very simple, I can't find the trap!! :x

Re: 1618 - Positions

Posted: Mon Sep 03, 2012 1:42 pm
by ymondelo20
Because the number of cases where the input is large, small differences between solutions may represent a cosiderable timeframe between both times.

Re: 1618 - Positions

Posted: Mon Sep 03, 2012 4:57 pm
by padrinoIJ
Thanks by suggestions, greetings ;)

Re: 1618 - Positions

Posted: Tue Sep 04, 2012 1:10 pm
by ymondelo20
The time was updated... 500 MS more, due to Java and C#.
However, optimal solutions may pass only with 1000 MS :)