teacher
Sign in

Interactive Problems

Talk to a judge program through standard input and output, flush after every query, stay under the query limit, and find hidden values with binary search.

35 minCF 1400–19005 interactive11 problems

The problem

In a normal problem you read the whole input, compute, and print the answer. In an interactive problem a second program, the judge (also called the interactor), holds a hidden secret. You learn about it only by asking queries, and each answer arrives after you ask.

  • Your output is the judge's input, and the judge's output is your input.
  • There is a query limit (for example 30 queries), and exceeding it gives Wrong Answer.
  • At the end you print the final answer in the format the statement asks for.
1 of 9