結果

問題 No.1438 Broken Drawers
ユーザー marroncastlemarroncastle
提出日時 2021-03-26 22:05:17
言語 PyPy3
(7.3.15)
結果
RE  
実行時間 -
コード長 384 bytes
コンパイル時間 308 ms
コンパイル使用メモリ 86,940 KB
実行使用メモリ 107,672 KB
最終ジャッジ日時 2023-08-19 08:25:15
合計ジャッジ時間 5,212 ms
ジャッジサーバーID
(参考情報)
judge9 / judge14
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 71 ms
71,076 KB
testcase_01 AC 70 ms
71,280 KB
testcase_02 AC 74 ms
71,092 KB
testcase_03 RE -
testcase_04 AC 71 ms
71,116 KB
testcase_05 AC 72 ms
71,052 KB
testcase_06 AC 116 ms
106,904 KB
testcase_07 AC 113 ms
106,888 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
ans = (N+1)//2
for i in range(0,N-1,2):
  if i+2<N:
    if A[i]<A[i+1]<A[i+2]:
      ans += 1
  elif A[i]<A[i+1]:
    ans += 1
ans2 = N//2
for i in range(0,N,2):
  if i==0:
    if A[i]<A[i+1]:
      ans2 += 1
  elif i==N-1:
    if A[i-1]<A[i]:
      ans2 += 1
  else:
    if A[i-1]<A[i]<A[i+1]:
      ans2 += 1
print(max(ans,ans2))
0