No.5014 Sextuple (reactive)
タグ : / 解いたユーザー数 15
作問者 :
trineutron
/ テスター :
butsurizuki
Note
This problem is a score-based version of the game Sextuple, devised by Wand (Twitter: @wand_125).
Problem Statement
Sextuple is a single-player game with the following rules.
- Repeat the following operation 36 times.
- Operation: Roll 6 six-sided dice simultaneously and place them in one of the unoccupied cells of a 6×6 table.
- After the 36 operations are finished, the following points are obtained for each row and each column.
- If there are values that appear in every cell of that row or column, 3 points for each such kind of value
- +1 point for each additional die showing those values
Page where you can play Sextuple (created by the game's designer)
In this problem, the dice results are given one roll at a time. The result of the last roll is not given.
For each of the 35 rolls excluding the last one, decide the cell in which to place it, so that the expected value of the score is as large as possible.
There are 100 test cases. The score of a test case is $46656(=6^6)$ times the expected value of the score after the 35th placement is finished. The sum of the scores of all test cases is the score of the submission.
Input and Output
This problem is a reactive problem.
The result of the $i$-th roll is given in the following format.
$d_{i,1}\ d_{i,2}\ d_{i,3}\ d_{i,4}\ d_{i,5}\ d_{i,6}$
$d_{i,j}$ is the value of die $j$ in the $i$-th roll, chosen uniformly at random from the integers satisfying $1 \le d_{i,j} \le 6$.
To place the result of the $i$-th roll in the cell at row $x_i$, column $y_i$, output in the following format.
$x_i\ y_i$
$x_i, y_i$ are integers satisfying $1 \le x_i, y_i \le 6$, and $(x_i, y_i) \neq (x_j, y_j)$ when $i \neq j$.
Flush standard output after each output. Otherwise, you may get TLE.
Repeat the above interaction 35 times.
If there is an error in the output of your program, the judge program outputs a negative integer according to the following rules. If you receive a negative integer, terminate your program immediately. If you do not, the result is undefined.
- -1: The judge could not convert the output to integers
- -2: You output $x_i, y_i$ outside the range $1 \le x_i, y_i \le 6$
- -3: You tried to place dice in a cell that is already occupied
Sample
Sample 1
Input
4 1 3 5 6 5 1 5 5 5 6 4 6 3 5 3 5 1 6 1 3 6 3 2 2 6 2 3 2 6 2 4 2 6 6 5 1 6 4 1 6 4 4 5 3 6 2 2 3 2 6 4 2 5 6 1 1 1 4 6 1 1 1 1 5 1 3 2 4 1 3 5 4 3 5 6 4 5 6 3 4 2 4 5 6 6 5 4 5 1 6 3 3 4 5 3 6 2 6 6 6 3 4 5 5 4 4 1 2 6 5 2 4 4 1 1 1 2 5 3 4 6 1 5 3 2 6 5 1 1 4 4 2 4 4 2 5 6 3 5 2 6 4 4 1 5 1 5 4 1 2 4 6 6 4 1 3 2 2 5 6 1 3 2 5 2 2 3 4 6 2 3 3 5 2 5 4 6 3 2 6 1 2 4 1 2 3 3 1 4 4 4 2 5 6 1 2 3 5 2 4 6 1 6 6 4 3 1 3 2
Output
3 5 1 6 4 1 5 4 4 4 2 3 4 6 6 2 3 6 5 5 4 2 3 1 6 3 5 2 1 2 6 5 2 6 2 5 2 1 2 2 3 2 6 4 4 3 3 3 6 6 1 5 1 1 5 6 1 4 5 3 3 4 4 5 5 1 1 3 6 1
The score is 2130332 points.
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。