結果

問題 No.123 カードシャッフル
ユーザー caleicalei
提出日時 2020-02-12 21:53:03
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 195 bytes
コンパイル時間 90 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 17,436 KB
最終ジャッジ日時 2024-04-14 23:01:25
合計ジャッジ時間 1,415 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,752 KB
testcase_01 AC 30 ms
10,752 KB
testcase_02 AC 32 ms
10,624 KB
testcase_03 AC 32 ms
10,624 KB
testcase_04 AC 30 ms
10,752 KB
testcase_05 AC 30 ms
10,624 KB
testcase_06 WA -
testcase_07 AC 29 ms
10,624 KB
testcase_08 AC 30 ms
10,752 KB
testcase_09 AC 30 ms
10,752 KB
testcase_10 AC 71 ms
12,612 KB
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n,m=map(int,input().split())
a=list(map(int,input().split()))
ans=1
for i in reversed(range(m)):
    if ans==1:
        ans=a[i]
    if a[i]==1:continue
    if a[i]>ans:
        ans-=1
print(ans)
0