結果

問題 No.26 シャッフルゲーム
ユーザー ABKZABKZ
提出日時 2021-06-18 12:07:31
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 76 ms / 5,000 ms
コード長 209 bytes
コンパイル時間 265 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 71,536 KB
最終ジャッジ日時 2023-09-04 03:10:51
合計ジャッジ時間 1,750 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,416 KB
testcase_01 AC 70 ms
71,516 KB
testcase_02 AC 74 ms
71,460 KB
testcase_03 AC 72 ms
71,192 KB
testcase_04 AC 76 ms
71,336 KB
testcase_05 AC 70 ms
71,496 KB
testcase_06 AC 73 ms
71,276 KB
testcase_07 AC 72 ms
71,376 KB
testcase_08 AC 71 ms
71,136 KB
testcase_09 AC 72 ms
71,536 KB
権限があれば一括ダウンロードができます

ソースコード

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