結果

問題 No.26 シャッフルゲーム
ユーザー ----
提出日時 2023-01-01 16:21:40
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 17 ms / 5,000 ms
コード長 360 bytes
コンパイル時間 781 ms
コンパイル使用メモリ 10,636 KB
実行使用メモリ 7,844 KB
最終ジャッジ日時 2023-08-17 23:05:02
合計ジャッジ時間 1,289 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,768 KB
testcase_01 AC 16 ms
7,780 KB
testcase_02 AC 16 ms
7,780 KB
testcase_03 AC 16 ms
7,784 KB
testcase_04 AC 16 ms
7,764 KB
testcase_05 AC 16 ms
7,824 KB
testcase_06 AC 16 ms
7,844 KB
testcase_07 AC 17 ms
7,844 KB
testcase_08 AC 16 ms
7,792 KB
testcase_09 AC 17 ms
7,764 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
kaisuu = int(input())
i = 0
basho = [0, 0, 0]
n -= 1
copy = 0
basho[n] = 1
while i < kaisuu:
    a, b = input().split()
    a = int(a)
    a -= 1
    b = int(b)
    b -= 1
    copy = basho[a]
    basho[a] = basho[b]
    basho[b] = copy
    i += 1
check = 0
i = 0
while check == 0:
    if basho[i] == 1:
        break
    i += 1
i += 1
print(i)
0