結果

問題 No.26 シャッフルゲーム
ユーザー yuppe19 😺yuppe19 😺
提出日時 2015-09-07 17:33:42
言語 Python2
(2.7.18)
結果
AC  
実行時間 12 ms / 5,000 ms
コード長 234 bytes
コンパイル時間 359 ms
コンパイル使用メモリ 6,680 KB
実行使用メモリ 6,100 KB
最終ジャッジ日時 2023-09-26 10:00:45
合計ジャッジ時間 1,030 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#!/usr/bin/python
# -*- coding: utf-8 -*-
n = int(raw_input())
a = [0, 0, 0]
a[n-1] = 1
m = int(raw_input())
for _ in xrange(m):
    p, q = map(lambda e: int(e)-1, raw_input().split())
    a[p], a[q] = a[q], a[p]
print a.index(1) + 1
0