Due to the installation of a new fire alarm in ITMO server room, the system may be occasionally unavailable on the 27-th of May between 06:00 and 15:00 (UTC). ×

mufaddalnaya's blog

By mufaddalnaya, history, 5 weeks ago, In English,

I've tried submitting a solution to problem 1146C — Tree Diameter Submission

But I get Idleness limit exceeded on test 1, I tested my code using Custom Test, but it seems to be working Okay, how can I fix this?

  • Vote: I like it  
  • +7
  • Vote: I do not like it  

5 weeks ago, # |
  Vote: I like it +13 Vote: I do not like it

After printing a query do not forget to output end of line and flush the output. Otherwise, you will get Idleness limit exceeded. To do this, use:

fflush(stdout) or cout.flush() in C++;
System.out.flush() in Java;
flush(output) in Pascal;
stdout.flush() in Python;
see documentation for other languages.
  • »
    5 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thanks, I got the mistake. By mistake I printed new line after flushing which caused the error.