結果
問題 | No.1438 Broken Drawers |
ユーザー | marroncastle |
提出日時 | 2021-03-26 22:06:42 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 413 bytes |
コンパイル時間 | 1,338 ms |
コンパイル使用メモリ | 87,288 KB |
実行使用メモリ | 107,824 KB |
最終ジャッジ日時 | 2023-08-19 08:26:46 |
合計ジャッジ時間 | 5,816 ms |
ジャッジサーバーID (参考情報) |
judge10 / judge14 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 70 ms
71,260 KB |
testcase_01 | AC | 69 ms
71,356 KB |
testcase_02 | AC | 70 ms
71,272 KB |
testcase_03 | AC | 70 ms
71,104 KB |
testcase_04 | AC | 71 ms
71,276 KB |
testcase_05 | AC | 70 ms
71,112 KB |
testcase_06 | AC | 113 ms
106,516 KB |
testcase_07 | AC | 112 ms
106,924 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 | - |
ソースコード
N = int(input()) A = list(map(int, input().split())) if N==1: print(1) exit() 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))