結果

問題 No.3191 Operation Puzzle
ユーザー Ziyan Gong
提出日時 2025-08-01 15:45:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 327 bytes
コンパイル時間 449 ms
コンパイル使用メモリ 12,288 KB
実行使用メモリ 10,496 KB
最終ジャッジ日時 2025-08-01 15:45:44
合計ジャッジ時間 4,149 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample WA * 2
other AC * 13 WA * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

def f(i, j):
    return (i + j - 1) % 4 + 1

N = int(input())
A = list(map(int, input().split()))
X = int(input())

res = A[0]
for i in range(1, N):
    res = f(res, A[i])

if res == X:
    print("Yes")
    for i in range(1, 5):
        row = [(i + j - 1) % 4 + 1 for j in range(1, 5)]
        print(*row)
else:
    print("No")
0