結果

問題 No.26 シャッフルゲーム
ユーザー szkhts
提出日時 2021-06-02 09:00:26
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 31 ms / 5,000 ms
コード長 270 bytes
コンパイル時間 396 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-11-14 07:06:26
合計ジャッジ時間 1,043 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    N = int(input())
    M = int(input())

    a = [0] * 3
    a[N - 1] = 1

    for i in range(M):
        f, t = map(int, input().split())
        a[t - 1], a[f - 1] = a[f - 1], a[t - 1]

    print(a.index(1) + 1)
    
if __name__ == '__main__':
    main()
0