結果

問題 No.26 シャッフルゲーム
ユーザー HIROPON87069639HIROPON87069639
提出日時 2016-02-27 20:32:50
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 200 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 7,124 KB
実行使用メモリ 6,472 KB
最終ジャッジ日時 2023-10-24 18:38:11
合計ジャッジ時間 716 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,472 KB
testcase_01 AC 11 ms
6,472 KB
testcase_02 AC 11 ms
6,472 KB
testcase_03 AC 11 ms
6,472 KB
testcase_04 AC 11 ms
6,472 KB
testcase_05 AC 12 ms
6,472 KB
testcase_06 AC 12 ms
6,472 KB
testcase_07 AC 12 ms
6,472 KB
testcase_08 AC 12 ms
6,472 KB
testcase_09 AC 12 ms
6,472 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-
N = input()
M = input()
cup =[0] * 3
cup[N-1] = 1
for i in range(M):
    P, Q = map(int, raw_input().split())
    cup[P-1], cup[Q-1] = cup[Q-1], cup[P-1]
print cup.index(1) + 1
0