RP_9's blog

By RP_9, history, 7 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://codeforces.net/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?
»
7 years ago, # |
  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".

  • »
    »
    7 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    Thank you very much Noam527

  • »
    »
    5 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    what if its not a interactive problem still after being stuck on a test gave for 5-8 odd minutes it gave me this... please have a look at my submission ..

    Can somebody help me how to overcome this??

    Thank you in advance.