結果

問題 No.123 カードシャッフル
ユーザー etale.K3etale.K3
提出日時 2021-02-24 10:30:13
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 73 ms / 5,000 ms
コード長 162 bytes
コンパイル時間 96 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 16,800 KB
最終ジャッジ日時 2024-09-24 10:13:35
合計ジャッジ時間 1,731 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

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

t = 1

for a in A:
    if t == 1:
        t = a
    elif a >= t:
        t -= 1

print(t)
0