結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,308 KB
testcase_01 AC 40 ms
53,308 KB
testcase_02 AC 39 ms
53,308 KB
testcase_03 AC 39 ms
53,308 KB
testcase_04 AC 38 ms
53,308 KB
testcase_05 AC 38 ms
53,308 KB
testcase_06 AC 41 ms
53,308 KB
testcase_07 AC 40 ms
53,308 KB
testcase_08 AC 39 ms
53,308 KB
testcase_09 AC 39 ms
53,308 KB
testcase_10 AC 100 ms
100,636 KB
testcase_11 AC 102 ms
102,656 KB
testcase_12 AC 67 ms
78,904 KB
testcase_13 AC 88 ms
94,568 KB
testcase_14 AC 93 ms
97,760 KB
testcase_15 AC 79 ms
87,888 KB
testcase_16 AC 55 ms
68,448 KB
testcase_17 AC 98 ms
99,832 KB
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 AC 102 ms
102,704 KB
testcase_24 AC 61 ms
79,732 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

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