結果

問題 No.921 ずんだアロー
ユーザー 👑 KazunKazun
提出日時 2020-12-09 04:17:21
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 324 bytes
コンパイル時間 178 ms
コンパイル使用メモリ 81,564 KB
実行使用メモリ 99,800 KB
最終ジャッジ日時 2023-10-19 04:42:00
合計ジャッジ時間 2,771 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,324 KB
testcase_01 AC 40 ms
53,324 KB
testcase_02 AC 39 ms
53,324 KB
testcase_03 AC 39 ms
53,324 KB
testcase_04 AC 41 ms
53,324 KB
testcase_05 AC 40 ms
53,324 KB
testcase_06 AC 41 ms
53,324 KB
testcase_07 AC 40 ms
53,324 KB
testcase_08 AC 39 ms
53,324 KB
testcase_09 AC 39 ms
53,324 KB
testcase_10 AC 101 ms
97,780 KB
testcase_11 AC 103 ms
99,752 KB
testcase_12 AC 67 ms
78,900 KB
testcase_13 AC 91 ms
94,992 KB
testcase_14 AC 97 ms
96,340 KB
testcase_15 AC 81 ms
88,164 KB
testcase_16 AC 55 ms
68,444 KB
testcase_17 AC 99 ms
98,148 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 102 ms
99,800 KB
testcase_24 AC 61 ms
79,728 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys

N=int(input())
A=list(map(int,input().split()))

X=[]
I=0
while I<N:
    J=I
    while J<N and A[I]==A[J]:
        J+=1
    X.append(J-I)
    I=J

print(X,file=sys.stderr)

K=len(X)
DP=[[0,0] for _ in range(K+1)]

for i in range(1,K+1):
    DP[i][1]=DP[i-1][0]+X[i-1]
    DP[i][0]=max(DP[i-1])
print(max(DP[-1]))
0