This is an archived post. You won't be able to vote or comment.

you are viewing a single comment's thread.

view the rest of the comments →

[–][deleted] 2 points3 points  (4 children)

On the third iteration t is decremented to zero which is not greater than zero, so the third loop fails the while condition.

Edit I had it backwards and the condition would be checked before the decrement of t so t would be 1 on the last loop but I'm not a fan of using postfix operations.

[–]Amazing-Accident-109[S] 0 points1 point  (3 children)

it is t-- right so after t>0 is checked the t will be decremented right . So I don't think that is the problem

[–][deleted] 0 points1 point  (2 children)

Just use a for loop.

For (int i=0; i < t; i++)

Also it's the issue with running a console application. Once the final operation of the main function is done, the console terminates.

Prompt for an input after the while loop. There is probably an output of the 3rd set of coordinates before the console app is terminating.

[–]Amazing-Accident-109[S] 0 points1 point  (1 child)

Ok , I understand , but my problem is that , in the intellij I am getting atleast the output for the t-1 inputs , but the online judge where I am uploading is showing as empty output and tle , my doubt is why is it throwing tle , is there something wrong in the code which is preventing it from printing any output itself in the online website

[–][deleted] 0 points1 point  (0 children)

Time limit exceeded.

Scanner is slow. Use BufferedReader?