結果

問題 No.921 ずんだアロー
ユーザー deideiro
提出日時 2019-11-25 21:44:45
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 173 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,312 KB
最終ジャッジ日時 2024-10-14 15:33:11
合計ジャッジ時間 3,235 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 WA * 1
other AC * 8 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 A[i] >= A[i+1]:
        ans += 1
    if i == N - 2:
        if A[i] <= A[i+1]:
            ans += 1

tmp = max(math.ceil(N / 2),max(C.values()))
ans = max(ans,tmp)
print(ans)
0