結果

問題 No.1438 Broken Drawers
ユーザー 小野寺健小野寺健
提出日時 2021-05-14 16:00:10
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 262 ms / 2,000 ms
コード長 214 bytes
コンパイル時間 77 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 31,888 KB
最終ジャッジ日時 2024-04-09 20:16:59
合計ジャッジ時間 5,950 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,752 KB
testcase_01 AC 27 ms
10,752 KB
testcase_02 AC 28 ms
10,752 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 AC 28 ms
10,752 KB
testcase_05 AC 29 ms
10,880 KB
testcase_06 AC 165 ms
29,548 KB
testcase_07 AC 158 ms
29,560 KB
testcase_08 AC 27 ms
10,752 KB
testcase_09 AC 28 ms
10,752 KB
testcase_10 AC 28 ms
10,752 KB
testcase_11 AC 35 ms
11,776 KB
testcase_12 AC 100 ms
18,660 KB
testcase_13 AC 148 ms
22,836 KB
testcase_14 AC 75 ms
16,044 KB
testcase_15 AC 232 ms
30,224 KB
testcase_16 AC 219 ms
29,668 KB
testcase_17 AC 237 ms
30,580 KB
testcase_18 AC 245 ms
31,012 KB
testcase_19 AC 248 ms
31,148 KB
testcase_20 AC 249 ms
31,304 KB
testcase_21 AC 243 ms
30,796 KB
testcase_22 AC 253 ms
31,568 KB
testcase_23 AC 249 ms
31,868 KB
testcase_24 AC 242 ms
31,884 KB
testcase_25 AC 251 ms
31,872 KB
testcase_26 AC 259 ms
31,888 KB
testcase_27 AC 262 ms
31,884 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())

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

B = sorted(list(range(len(A))), key=lambda i : A[i])

cnt = 0
for i in B:
    if A[i] > 0:
        cnt += 1
        if i > 0:
            A[i-1] = 0
print(cnt)
0