結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 27 ms
10,880 KB
testcase_01 AC 27 ms
10,880 KB
testcase_02 AC 27 ms
10,752 KB
testcase_03 AC 27 ms
10,624 KB
testcase_04 AC 26 ms
10,624 KB
testcase_05 WA -
testcase_06 AC 26 ms
10,752 KB
testcase_07 AC 27 ms
10,880 KB
testcase_08 AC 28 ms
10,624 KB
testcase_09 AC 27 ms
10,752 KB
testcase_10 AC 101 ms
19,888 KB
testcase_11 WA -
testcase_12 AC 47 ms
13,524 KB
testcase_13 AC 85 ms
19,552 KB
testcase_14 AC 95 ms
19,988 KB
testcase_15 AC 67 ms
17,244 KB
testcase_16 AC 32 ms
11,776 KB
testcase_17 AC 98 ms
20,112 KB
testcase_18 AC 117 ms
20,772 KB
testcase_19 AC 117 ms
20,768 KB
testcase_20 WA -
testcase_21 AC 121 ms
20,768 KB
testcase_22 AC 112 ms
20,768 KB
testcase_23 AC 110 ms
25,048 KB
testcase_24 AC 117 ms
20,768 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 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)
0