結果

問題 No.123 カードシャッフル
ユーザー 🍡yurahuna🍡yurahuna
提出日時 2016-01-24 11:33:05
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 65 ms / 5,000 ms
コード長 192 bytes
コンパイル時間 108 ms
コンパイル使用メモリ 11,772 KB
実行使用メモリ 17,952 KB
最終ジャッジ日時 2023-10-21 13:55:49
合計ジャッジ時間 1,289 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 24 ms
10,020 KB
testcase_01 AC 24 ms
10,020 KB
testcase_02 AC 25 ms
10,020 KB
testcase_03 AC 24 ms
10,020 KB
testcase_04 AC 25 ms
10,020 KB
testcase_05 AC 23 ms
10,020 KB
testcase_06 AC 24 ms
10,020 KB
testcase_07 AC 24 ms
10,020 KB
testcase_08 AC 24 ms
10,020 KB
testcase_09 AC 23 ms
10,020 KB
testcase_10 AC 53 ms
11,828 KB
testcase_11 AC 65 ms
17,952 KB
testcase_12 AC 65 ms
16,828 KB
testcase_13 AC 61 ms
16,836 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, M = map(int, input().split())
top = 1
a = list(map(int, input().split()))
for i in range(M-1, -1, -1):
    if top == 1:
        top = a[i]
    elif top <= a[i]:
        top -= 1
print(top)
0