結果

問題 No.123 カードシャッフル
ユーザー Luoto-green
提出日時 2017-07-06 11:51:36
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 65 ms / 5,000 ms
コード長 188 bytes
コンパイル時間 196 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,220 KB
最終ジャッジ日時 2024-10-06 03:33:41
合計ジャッジ時間 1,465 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 4
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m = map(int,input().split())
s = list(map(int,input().split()))
a =[i for i in range(1,n+1)]
p = 1
for i in s[::-1]:
    if p == 1:
        p = i
    elif i >= p:
        p -= 1
print(p)
0