結果

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

ソースコード

diff #

# coding: utf-8
# yukicoder No.26 シャッフルゲーム

N = int(input())
maru = [1 if i == (N - 1) else 0 for i in range(3)] # 1 = ○, 0 = ×

M = int(input())

for _ in range(M):
    i, j = map(int, input().split())
    maru[i - 1], maru[j - 1] = maru[j - 1], maru[i - 1] # カップの入れ替え

# ○の付いたカップの番号を出力
print(maru.index(1) + 1)
0