Блог пользователя shankysodhi

Автор shankysodhi, 15 лет назад, По-английски

Hi everybody .

I participated in the CodeChef's June Cook Off challenge ... or should i say i tried to participate in it . The reason being ,i got stuck at the very first problem . Every time i submit the solution i got TLE. The frustration continued for about 2 hrs with no luck what so ever. I asked the problem setters/testers there to please explain what was the problem but got no response (even after the contest was over). So i was hoping u guys could help me . Its not much of a problem (that was the frustrating part).

The problem is available at :

http://www.codechef.com/problems/KNIGHTMV/

I have my solutions as : ( in the order .... lastest solution to the oldest solution )

http://www.codechef.com/viewsolution/578839
http://www.codechef.com/viewsolution/578334
http://www.codechef.com/viewsolution/578234
http://www.codechef.com/viewsolution/578111

I am no expert in programming (as reflected in the color of my handle) ... so i guess the error(if any) will be minor.

If you got time ....please go through it .. will appreciate any help .... Thanks. :)

  • Проголосовать: нравится
  • +6
  • Проголосовать: не нравится

15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
I've got TLE, too. With this code.
15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
Try using PrintWriter
http://pastie.org/2092670
15 лет назад, скрыть # |
 
Проголосовать: нравится 0 Проголосовать: не нравится
@cerealguy/Scorpy : Amazing the same solution works with printwriter with the execution time of 0.55s . But i am still blank . What difference does it make, considering the fact that even printwriter uses System.out and the instance of printwriter uses .println. And even if there is difference , could it have eaten up more than .45s .... i mean thats roughly equal to the time for the execution of the algo(using printwriter) ???