RP_9's blog

By RP_9, history, 3 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.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

»
3 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".

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

    Thank you very much Noam527

  • »
    »
    13 months 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.

    • »
      »
      »
      13 months ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Try accepting the entire input first and then perform the operations

    • »
      »
      »
      6 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      Have you learnt the reason for this? I also faced with this issue: 89464032