結果

問題 No.123 カードシャッフル
ユーザー yomo3yomo3
提出日時 2020-02-11 22:27:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 78 ms / 5,000 ms
コード長 192 bytes
コンパイル時間 1,207 ms
コンパイル使用メモリ 11,648 KB
実行使用メモリ 18,100 KB
最終ジャッジ日時 2024-04-08 16:00:21
合計ジャッジ時間 1,508 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
9,856 KB
testcase_01 AC 33 ms
9,856 KB
testcase_02 AC 30 ms
9,856 KB
testcase_03 AC 29 ms
9,856 KB
testcase_04 AC 31 ms
9,856 KB
testcase_05 AC 30 ms
9,856 KB
testcase_06 AC 30 ms
9,856 KB
testcase_07 AC 29 ms
9,856 KB
testcase_08 AC 29 ms
9,856 KB
testcase_09 AC 30 ms
9,856 KB
testcase_10 AC 62 ms
11,776 KB
testcase_11 AC 78 ms
18,100 KB
testcase_12 AC 72 ms
16,976 KB
testcase_13 AC 70 ms
16,984 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

ans = 1
for i in range(M-1, -1, -1):
    if ans == 1:
        ans = A[i]
    elif A[i] >= ans:
        ans -= 1
print(ans)
0