結果

問題 No.26 シャッフルゲーム
ユーザー Theta
提出日時 2022-11-01 11:41:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 28 ms / 5,000 ms
コード長 305 bytes
コンパイル時間 91 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-07-16 05:38:45
合計ジャッジ時間 962 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

def main():
    cups = [False, False, False]
    N = int(input())
    cups[N-1] = True
    for _ in range(int(input())):
        cup1, cup2 = map(int, input().split())
        cups[cup1-1], cups[cup2-1] = cups[cup2-1], cups[cup1-1]

    print(cups.index(True) + 1)


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