結果

問題 No.26 シャッフルゲーム
ユーザー momoyuumomoyuu
提出日時 2022-08-02 23:54:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 175 bytes
コンパイル時間 279 ms
コンパイル使用メモリ 86,736 KB
実行使用メモリ 71,260 KB
最終ジャッジ日時 2023-10-01 00:31:36
合計ジャッジ時間 1,855 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 75 ms
71,020 KB
testcase_01 AC 77 ms
71,208 KB
testcase_02 AC 78 ms
71,088 KB
testcase_03 AC 75 ms
71,252 KB
testcase_04 AC 77 ms
70,992 KB
testcase_05 AC 75 ms
71,180 KB
testcase_06 AC 78 ms
71,092 KB
testcase_07 AC 76 ms
70,984 KB
testcase_08 AC 76 ms
71,260 KB
testcase_09 AC 76 ms
70,812 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
M = int(input())
now = N 
for i in range(M):
    p,q = map(int,input().split())
    if p == now:
        now = q
    elif q == now:
        now = p
print(now)
0