結果

問題 No.26 シャッフルゲーム
ユーザー brthyyjpbrthyyjp
提出日時 2020-12-25 13:51:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 233 bytes
コンパイル時間 579 ms
コンパイル使用メモリ 81,804 KB
実行使用メモリ 53,568 KB
最終ジャッジ日時 2023-10-22 05:39:53
合計ジャッジ時間 1,626 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,568 KB
testcase_01 AC 36 ms
53,568 KB
testcase_02 AC 39 ms
53,568 KB
testcase_03 AC 37 ms
53,568 KB
testcase_04 AC 37 ms
53,568 KB
testcase_05 AC 38 ms
53,568 KB
testcase_06 AC 38 ms
53,568 KB
testcase_07 AC 38 ms
53,568 KB
testcase_08 AC 38 ms
53,568 KB
testcase_09 AC 39 ms
53,568 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
n -= 1
L = [0]*3
L[n] = 1
m = int(input())
for i in range(m):
    p,q = map(int, input().split())
    p,q = p-1, q-1
    L[p], L[q] = L[q], L[p]
for i in range(3):
    if L[i] == 1:
        print(i+1)
        exit()
0