結果

問題 No.123 カードシャッフル
ユーザー ssmkzkssmkzk
提出日時 2018-07-24 01:08:50
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 68 ms / 5,000 ms
コード長 212 bytes
コンパイル時間 141 ms
コンパイル使用メモリ 10,568 KB
実行使用メモリ 16,028 KB
最終ジャッジ日時 2023-08-30 20:54:27
合計ジャッジ時間 1,392 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 15 ms
7,936 KB
testcase_01 AC 15 ms
7,804 KB
testcase_02 AC 15 ms
7,764 KB
testcase_03 AC 15 ms
7,944 KB
testcase_04 AC 15 ms
7,752 KB
testcase_05 AC 16 ms
7,748 KB
testcase_06 AC 15 ms
7,744 KB
testcase_07 AC 15 ms
7,752 KB
testcase_08 AC 14 ms
7,764 KB
testcase_09 AC 14 ms
7,772 KB
testcase_10 AC 61 ms
9,844 KB
testcase_11 AC 64 ms
16,028 KB
testcase_12 AC 65 ms
14,884 KB
testcase_13 AC 68 ms
14,900 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
l = list(map(int, input().split()))
d = [] 
for i in range(1, N + 1):
    d.append(i)

s = 0
for i in l:
    s = d[i - 1]
    d.pop(i - 1)
    d.insert(0, s)
    

print(d[0])    
0