Interactive Problems and the way to deal with them!

Nope

What does running time -1.00 imply?

implies WA

what is the best way to terminate the programme at the required point in interactive problems?

In a function other than main() use exit(0) otherwise return .

Thanks bro :pray:t2::pray:t2::pray:t2: I was gone mad after watching these type of problem. Even now I didn’t get the solution,but have the hope that I can learn and implement may be not right now but in very short time

1 Like

What is the difference between WA (-1.000000) and WA (0.000000)?

hey! my code is showing SIGTSTP this error can you please help

WA(-1.000) means your program is going out of constraints, like asking more queries than the allowed queries. Whereas WA(0.000) simply means wrong answer, but within constraints.

1 Like

Thanks mate

Did you get WA(-1.000) in the guessing game problem of present contest?

2 Likes

Yes, actually I got both hence wanted clarification

what about python? because in python until we use end, it flushes out automatically?

You can use below options:

  1. print(“YOUR TEXT”,flush=True)
  2. import sys; sys.stdout.flush() //just before taking input and after printing

I am solving a interactive problem on codechef and i get correct answer in my terminal but for exactly same input the answer fails on codeforces. can you give me some hint why is it so

here is my solution

im using fast input output c++ so in interactive problem if i just write cout<<“query…etc”<<endl; so now endl is enough or i need to write fflush(stdout) and do i need to remove fast input io for inetractive problems??

Important point Remember to close the output stream after the program completes. The reason is, that your program may keep waiting for grader while grader has completed its execution. It may lead to an unexpected verdict.
Can somebody explain to me how to close the output stream at the end?
And why do we require it??
Thank you.