結果

問題 No.1438 Broken Drawers
ユーザー 👑 H20H20
提出日時 2021-03-26 23:00:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 143 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 917 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 109,252 KB
最終ジャッジ日時 2023-08-19 09:43:33
合計ジャッジ時間 5,202 ms
ジャッジサーバーID
(参考情報)
judge15 / judge9
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 70 ms
71,444 KB
testcase_01 AC 73 ms
71,208 KB
testcase_02 AC 72 ms
71,496 KB
testcase_03 AC 72 ms
71,468 KB
testcase_04 AC 70 ms
71,332 KB
testcase_05 AC 71 ms
71,380 KB
testcase_06 AC 120 ms
108,836 KB
testcase_07 AC 121 ms
109,012 KB
testcase_08 AC 70 ms
71,520 KB
testcase_09 AC 69 ms
71,516 KB
testcase_10 AC 69 ms
71,564 KB
testcase_11 AC 81 ms
76,444 KB
testcase_12 AC 102 ms
87,424 KB
testcase_13 AC 117 ms
95,968 KB
testcase_14 AC 97 ms
83,496 KB
testcase_15 AC 133 ms
105,264 KB
testcase_16 AC 134 ms
105,596 KB
testcase_17 AC 138 ms
108,748 KB
testcase_18 AC 138 ms
108,556 KB
testcase_19 AC 138 ms
108,572 KB
testcase_20 AC 140 ms
108,820 KB
testcase_21 AC 140 ms
108,596 KB
testcase_22 AC 141 ms
109,032 KB
testcase_23 AC 143 ms
109,088 KB
testcase_24 AC 139 ms
109,192 KB
testcase_25 AC 139 ms
109,252 KB
testcase_26 AC 138 ms
109,176 KB
testcase_27 AC 139 ms
109,168 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import itertools
N = int(input())
A = list(map(int, input().split())) 
L = [0]*N
ans = 1
for i in range(1,N):
    if A[i-1]<A[i]:
        ans+=1
    else:
        L[i]=1
gr = itertools.groupby(L)
for key, group in gr:
    if key == 1:
        ans += len(list(group))//2
print(ans)
0