結果

問題 No.921 ずんだアロー
ユーザー deideirodeideiro
提出日時 2019-11-25 21:44:45
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 391 bytes
コンパイル時間 94 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 25,172 KB
最終ジャッジ日時 2024-04-22 16:22:56
合計ジャッジ時間 3,301 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
10,880 KB
testcase_01 WA -
testcase_02 AC 28 ms
10,880 KB
testcase_03 AC 28 ms
10,880 KB
testcase_04 AC 29 ms
10,880 KB
testcase_05 WA -
testcase_06 AC 29 ms
11,008 KB
testcase_07 WA -
testcase_08 AC 29 ms
10,880 KB
testcase_09 AC 29 ms
10,880 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 84 ms
19,412 KB
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 AC 112 ms
25,172 KB
testcase_24 AC 107 ms
20,880 KB
権限があれば一括ダウンロードができます

ソースコード

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