結果

問題 No.26 シャッフルゲーム
ユーザー cologne
提出日時 2022-01-23 14:07:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 38 ms / 5,000 ms
コード長 264 bytes
コンパイル時間 206 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 52,096 KB
最終ジャッジ日時 2024-11-29 13:52:10
合計ジャッジ時間 1,166 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

input = sys.stdin.readline


def main():
    N = int(input())
    M = int(input())
    for i in range(M):
        a, b = map(int, input().split())
        if a == N or b == N:
            N = a+b-N

    print(N)


if __name__ == '__main__':
    main()
0