結果

問題 No.1438 Broken Drawers
ユーザー 👑 H20H20
提出日時 2021-03-26 23:00:47
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 103 ms / 2,000 ms
コード長 281 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 118,784 KB
最終ジャッジ日時 2024-05-06 16:56:21
合計ジャッジ時間 3,256 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,712 KB
testcase_01 AC 35 ms
51,712 KB
testcase_02 AC 34 ms
52,096 KB
testcase_03 AC 34 ms
52,096 KB
testcase_04 AC 34 ms
51,840 KB
testcase_05 AC 33 ms
51,968 KB
testcase_06 AC 85 ms
108,160 KB
testcase_07 AC 85 ms
118,784 KB
testcase_08 AC 34 ms
52,480 KB
testcase_09 AC 33 ms
51,968 KB
testcase_10 AC 33 ms
52,352 KB
testcase_11 AC 45 ms
64,640 KB
testcase_12 AC 66 ms
86,668 KB
testcase_13 AC 78 ms
94,564 KB
testcase_14 AC 64 ms
82,176 KB
testcase_15 AC 101 ms
104,320 KB
testcase_16 AC 97 ms
103,808 KB
testcase_17 AC 100 ms
107,904 KB
testcase_18 AC 98 ms
107,648 KB
testcase_19 AC 98 ms
107,648 KB
testcase_20 AC 97 ms
107,596 KB
testcase_21 AC 101 ms
107,904 KB
testcase_22 AC 98 ms
107,648 KB
testcase_23 AC 103 ms
108,196 KB
testcase_24 AC 100 ms
107,904 KB
testcase_25 AC 98 ms
108,032 KB
testcase_26 AC 99 ms
108,288 KB
testcase_27 AC 100 ms
108,288 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