By mufaddalnaya, history, 6 months ago, ,

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?

• +7

 » 6 months ago, # |   +13 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.
•  » » 6 months ago, # ^ |   0 Thanks, I got the mistake. By mistake I printed new line after flushing which caused the error.