結果

問題 No.123 カードシャッフル
ユーザー magurogumamaguroguma
提出日時 2017-09-24 03:09:18
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 96 ms / 5,000 ms
コード長 230 bytes
コンパイル時間 242 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 17,268 KB
最終ジャッジ日時 2024-11-14 05:58:56
合計ジャッジ時間 1,703 ms
ジャッジサーバーID
(参考情報)
judge5 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

# -*- coding: utf-8 -*-

N,M = map(int, input().split())
A = list(map(int, input().split()))

cards = list(range(N+1))

for i in range(M):
    new_top = cards[A[i]]
    del cards[A[i]]
    cards.insert(1, new_top)

print(cards[1])
0