結果

問題 No.26 シャッフルゲーム
ユーザー ABKZ
提出日時 2021-06-18 12:07:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 209 bytes
コンパイル時間 459 ms
コンパイル使用メモリ 82,136 KB
実行使用メモリ 54,388 KB
最終ジャッジ日時 2024-06-22 02:54:08
合計ジャッジ時間 1,508 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
M = int(input())
sw = [list(map(int, input().split())) for _ in range(M)]

pos = list(range(1, 4))
for p, q in sw:
    pos[p - 1], pos[q - 1] = pos[q - 1], pos[p - 1]

print(pos.index(N) + 1)
0