結果

問題 No.123 カードシャッフル
ユーザー kutsutamakutsutama
提出日時 2019-01-19 10:53:06
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 105 ms / 5,000 ms
コード長 209 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 10,548 KB
実行使用メモリ 16,092 KB
最終ジャッジ日時 2023-09-22 22:27:30
合計ジャッジ時間 1,599 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,920 KB
testcase_01 AC 16 ms
7,732 KB
testcase_02 AC 16 ms
7,788 KB
testcase_03 AC 15 ms
7,780 KB
testcase_04 AC 16 ms
7,764 KB
testcase_05 AC 15 ms
7,796 KB
testcase_06 AC 16 ms
7,792 KB
testcase_07 AC 16 ms
7,780 KB
testcase_08 AC 15 ms
7,776 KB
testcase_09 AC 16 ms
7,916 KB
testcase_10 AC 78 ms
9,880 KB
testcase_11 AC 105 ms
16,092 KB
testcase_12 AC 100 ms
14,868 KB
testcase_13 AC 102 ms
14,808 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, m = [int(x) for x in input().split()]
a = [int(x) for x in input().split()]

card = list(range(1, n + 1))
for ai in a:
    top = card[ai - 1]
    card[1:ai] = card[0:ai-1]
    card[0] = top

print(card[0])
0