Cursed Game
문제
You found an antique box in your warehouse and decided to open it. The moment you open the box, it traps you into a cursed game where you are playing against a demon. The game consists of rounds and you have to win all rounds in order to escape. The demon also gives you coins that you can use throughout all rounds.
Note that in this problem, denote cell of a grid as the cell in row and column of the grid.
Before the start of each round, the demon will prepare a secret paper, which can be represented as a grid with rows and columns, both numbered from to . The demon will secretly put a hole in one or more cells, and you are not aware which cells have a hole in it. Then, the round starts with the demon giving you an odd integer (3 ≤ N ≤ 33).
Within each round, you can ask the demon several queries, each costing you one coin. For each query, you are allowed to give the demon your paper, which can be represented as a grid with rows and columns, both numbered from to . Each cell is coloured either black or white by you.
For each of your query, the demon will calculate a binary result grid with rows and columns, both numbered from to . The value on cell of the result grid is filled as follows.
- The demon will put the secret paper on top of your paper such that the cell of your paper aligns with the cell of the secret paper, for 1 ≤ i, j ≤ 3.
- The demon can only see the colour of the cell in your paper if the corresponding cell in the secret paper has a hole in it.
- The value on cell of the result grid is if there is an odd number of black cells that it can see through the holes, or otherwise.
You win the round if the result grid consists of only the values . Otherwise, the demon will give you the result grid as a feedback, and the round continues.
If you have spent all the coins and still did not win all the rounds, then you will be trapped forever. Escape the cursed game!
예제
예제 1
3 INCORRECT 0 CORRECT 5 INCORRECT 111 001 111 CORRECT (start of round 3, continue until 333 rounds)
111 000 111 111 111 111 10011 10011 00000 11010 11011 11011 11011 00100 11011 11011