結果

問題 No.1438 Broken Drawers
ユーザー gorugo30gorugo30
提出日時 2021-03-26 21:26:16
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 358 ms / 2,000 ms
コード長 241 bytes
コンパイル時間 468 ms
コンパイル使用メモリ 87,280 KB
実行使用メモリ 113,116 KB
最終ジャッジ日時 2023-08-19 07:02:15
合計ジャッジ時間 8,015 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,324 KB
testcase_01 AC 72 ms
71,300 KB
testcase_02 AC 73 ms
71,368 KB
testcase_03 AC 75 ms
71,336 KB
testcase_04 AC 75 ms
71,568 KB
testcase_05 AC 75 ms
71,572 KB
testcase_06 AC 141 ms
112,920 KB
testcase_07 AC 140 ms
112,912 KB
testcase_08 AC 72 ms
71,364 KB
testcase_09 AC 72 ms
71,180 KB
testcase_10 AC 71 ms
71,368 KB
testcase_11 AC 86 ms
76,736 KB
testcase_12 AC 161 ms
89,564 KB
testcase_13 AC 249 ms
103,488 KB
testcase_14 AC 132 ms
84,640 KB
testcase_15 AC 317 ms
109,968 KB
testcase_16 AC 312 ms
110,296 KB
testcase_17 AC 324 ms
112,944 KB
testcase_18 AC 333 ms
112,988 KB
testcase_19 AC 348 ms
113,048 KB
testcase_20 AC 341 ms
113,096 KB
testcase_21 AC 342 ms
113,112 KB
testcase_22 AC 345 ms
113,100 KB
testcase_23 AC 354 ms
112,988 KB
testcase_24 AC 358 ms
112,804 KB
testcase_25 AC 347 ms
112,772 KB
testcase_26 AC 353 ms
113,116 KB
testcase_27 AC 350 ms
113,088 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
used = [False] * N
l = [i for i in range(N)]
l.sort(key = lambda x: A[x])
ans = 0
for i in l:
    if i != N - 1 and used[i + 1]:
        continue
    used[i] = True
    ans += 1
print(ans)
0