結果

問題 No.123 カードシャッフル
ユーザー daku9640daku9640
提出日時 2016-10-11 07:51:42
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 155 ms / 5,000 ms
コード長 235 bytes
コンパイル時間 98 ms
コンパイル使用メモリ 10,696 KB
実行使用メモリ 16,520 KB
最終ジャッジ日時 2023-08-14 06:28:17
合計ジャッジ時間 1,844 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 19 ms
8,604 KB
testcase_01 AC 20 ms
8,608 KB
testcase_02 AC 18 ms
8,524 KB
testcase_03 AC 18 ms
8,620 KB
testcase_04 AC 18 ms
8,648 KB
testcase_05 AC 18 ms
8,608 KB
testcase_06 AC 18 ms
8,612 KB
testcase_07 AC 18 ms
8,616 KB
testcase_08 AC 18 ms
8,456 KB
testcase_09 AC 18 ms
8,432 KB
testcase_10 AC 66 ms
10,384 KB
testcase_11 AC 155 ms
16,520 KB
testcase_12 AC 120 ms
15,372 KB
testcase_13 AC 122 ms
15,456 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import deque
n, m = map(int, input().split())
a = list(map(int, input().split()))
dq = deque([i for i in range(1, n + 1)])
for i in a:
    t = dq[i - 1]
    dq.remove(dq[i - 1])
    dq.appendleft(t)
print(dq.popleft())
0