結果

問題 No.26 シャッフルゲーム
ユーザー tobusakanatobusakana
提出日時 2022-11-20 11:20:40
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 42 ms / 5,000 ms
コード長 254 bytes
コンパイル時間 1,288 ms
コンパイル使用メモリ 81,644 KB
実行使用メモリ 53,400 KB
最終ジャッジ日時 2023-10-21 11:08:04
合計ジャッジ時間 1,645 ms
ジャッジサーバーID
(参考情報)
judge14 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

N = int(input())
cup = [False] * 3
cup[N - 1] = True
M = int(input())
for _ in range(M):
    P,Q = map(int,input().split())
    cup[P - 1], cup[Q - 1] = cup[Q - 1], cup[P - 1]
    
for i in range(3):
    if cup[i]:
        print(i + 1)
        break
    
0