A new problem type where your program runs twice and must pass information from the first run to the second.
Toph now supports a new kind of programming problem: run-twice problems.
In a run-twice problem, your program runs twice for every test case. Nothing in memory survives between the two runs. The only thing that carries over is what your program prints in the first run, and the challenge is to use that limited output to solve the problem in the second run.
Want to try one? Solve Binary Relay.
Choose Run Twice when creating a problem in Drafts. You then write a small program, the relay, that runs between the two runs. It checks what the first run printed and prepares the input for the second run.
Each test case can also carry hidden data: information only your relay and checker can read, such as a question that is asked only in the second run.
Read Run-Twice Problems to get started.
The first line of input tells your program which run it is in: 1 for the first run, 2 for the second. The examples in the problem statement show both runs side by side.
Read Run-Twice Problems to learn more.
If you have any questions or need assistance, please don’t hesitate to contact Toph support or join the conversation in our community forum.