結果

問題 No.26 シャッフルゲーム
ユーザー momoyuu
提出日時 2022-08-02 23:54:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 40 ms / 5,000 ms
コード長 175 bytes
コンパイル時間 282 ms
コンパイル使用メモリ 82,196 KB
実行使用メモリ 52,820 KB
最終ジャッジ日時 2024-07-23 18:08:52
合計ジャッジ時間 1,193 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

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