Rating changes for last rounds are temporarily rolled back. They will be returned soon. ×

RP_9's blog

By RP_9, history, 8 years ago, In English

I have tried to submit the solution to the problem which is shown below. I tried a lot but still get idleness limit exceeded.

This is my solution link.

http://mirror.codeforces.com/contest/916/submission/35832727

Can somebody help me how to overcome this??

Thank you in advance.

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

| Write comment?
»
8 years ago, hide # |
 
Vote: I like it +20 Vote: I do not like it

The mentioned problem is an interactive problem. Every interactive problem on CF will contain the following text (or some variation of it) in the bottom of the statement. Here it says:

If the operation is a query, you should output the result of the query and flush the output stream before proceeding to the next operation. Otherwise, you may get the verdict Idleness Limit Exceed.

What you did in your code is solving the queries offline; you took all the queries and processed them together. In interactive problems you're not allowed to do that; you must output whenever the statement says it is necessary, and then flush the output (which is also explained in the problem statement), otherwise you get the verdict "Idleness limit exceeded".