結果

問題 No.26 シャッフルゲーム
ユーザー もぐら 3.0
提出日時 2023-11-14 08:18:26
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 39 ms / 5,000 ms
コード長 167 bytes
コンパイル時間 142 ms
コンパイル使用メモリ 82,492 KB
実行使用メモリ 52,992 KB
最終ジャッジ日時 2024-09-26 03:30:38
合計ジャッジ時間 1,127 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
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