結果
| 問題 |
No.921 ずんだアロー
|
| コンテスト | |
| ユーザー |
deideiro
|
| 提出日時 | 2019-11-25 22:13:55 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 479 bytes |
| コンパイル時間 | 314 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 25,104 KB |
| 最終ジャッジ日時 | 2024-10-14 16:42:23 |
| 合計ジャッジ時間 | 3,194 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 19 WA * 3 |
ソースコード
#yukicoder 921 ずんだアロー
import math
from collections import Counter
N = int(input())
A = list(map(int,input().split()))
if N == 1:
print(1)
exit()
C = Counter(A)
ans = 0
for i in range(N-1):
if i == 0:
if A[i] >= A[i+1]:
ans += 1
else:
if A[i] >= A[i+1] and A[i-1] <= A[i]:
ans += 1
if i == N - 2 and A[i] <= A[i+1]:
ans += 1
tmp = max(math.ceil(N / 2),max(C.values()))
ans = max(ans,tmp)
print(ans)
deideiro