結果

問題 No.26 シャッフルゲーム
ユーザー Kude
提出日時 2020-09-04 18:08:52
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 41 ms / 5,000 ms
コード長 178 bytes
コンパイル時間 154 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 52,864 KB
最終ジャッジ日時 2024-11-26 09:05:23
合計ジャッジ時間 1,050 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
s = [0] * 3
s[n-1] = 1
for _ in range(int(input())):
    p, q = map(int, input().split())
    p -= 1
    q -= 1
    s[p], s[q] = s[q], s[p]
print(s.index(1) + 1)
0