問題一覧 > スコア問題

No.5013 Sextuple (open)

レベル : / 実行時間制限 : 1ケース 2.000秒 / メモリ制限 : 512 MB / スペシャルジャッジ問題 (複数の解が存在する可能性があります)
タグ : (解説公開後に AC するまで非表示) / 解いたユーザー数 17
作問者 : trineutron / テスター : butsurizuki
お気に入りにしたユーザー ProblemId : 8615 / 自分の提出
問題文最終更新日: 2022-12-18 17:26:31
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence. Back to the original
yukicoder score contest 3 (順位表) の他の問題:

Note

This problem is a score-based version of the game "Sextuple" devised by Wando (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 is a face value that appears in every cell of that row or column, 3 points for each such kind of face value
    • +1 point for each additional die showing those face values

A page where you can play Sextuple (made by the game's creator)

In this problem, all dice rolls are given as input at the beginning.

Decide the cell in which to place the dice for each of the 36 operations, and obtain as high a score as possible.

There are 100 test cases. The sum of the scores of all test cases is the score of the submission.

Input

$d_{1,1}\ d_{1,2}\ d_{1,3}\ d_{1,4}\ d_{1,5}\ d_{1,6}$
$d_{2,1}\ d_{2,2}\ d_{2,3}\ d_{2,4}\ d_{2,5}\ d_{2,6}$
$\vdots$
$d_{36,1}\ d_{36,2}\ d_{36,3}\ d_{36,4}\ d_{36,5}\ d_{36,6}$

$d_{i,j}$ is the value rolled on die $j$ in the $i$-th operation, chosen uniformly at random from the integers satisfying $1 \le d_{i,j} \le 6$.

Output

Output 36 lines. If you place the dice rolled in the $i$-th operation in the cell at row $x_i$ and column $y_i$, output $x_i$ and $y_i$ separated by a space on the $i$-th line.

$x_i, y_i$ must be integers satisfying $1 \le x_i, y_i \le 6$, and $(x_i, y_i) \neq (x_j, y_j)$ must hold whenever $i \neq j$.

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
6 5 3 2 3 6
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
2 4

The board will be as shown in the image below. The score is 48 points.

サンプル入出力に対応する盤面

提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。