結果

問題 No.123 カードシャッフル
ユーザー shinshin
提出日時 2022-10-10 10:48:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 68 ms / 5,000 ms
コード長 288 bytes
コンパイル時間 89 ms
コンパイル使用メモリ 10,660 KB
実行使用メモリ 15,512 KB
最終ジャッジ日時 2023-09-06 11:42:17
合計ジャッジ時間 1,730 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 14 ms
7,780 KB
testcase_01 AC 14 ms
7,848 KB
testcase_02 AC 14 ms
7,764 KB
testcase_03 AC 14 ms
7,768 KB
testcase_04 AC 15 ms
7,852 KB
testcase_05 AC 15 ms
7,812 KB
testcase_06 AC 15 ms
7,760 KB
testcase_07 AC 14 ms
7,848 KB
testcase_08 AC 15 ms
7,776 KB
testcase_09 AC 13 ms
7,812 KB
testcase_10 AC 54 ms
9,236 KB
testcase_11 AC 66 ms
15,512 KB
testcase_12 AC 68 ms
14,616 KB
testcase_13 AC 68 ms
14,500 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#カードシャッフル

line1 = input()
N = int(line1.split(" " )[0])
M = int(line1.split(" " )[1])

line2 = input()
a = line2.split(" " )

card = [1]
for i in range(2 , N+1):
    card.insert(len(card), i)

for i in a:
    c = card.pop(int(i) - 1)
    card.insert(0, c)

print(card[0])
0