結果
| 問題 |
No.921 ずんだアロー
|
| コンテスト | |
| ユーザー |
👑 Kazun
|
| 提出日時 | 2020-12-09 04:14:28 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 286 bytes |
| コンパイル時間 | 293 ms |
| コンパイル使用メモリ | 82,408 KB |
| 実行使用メモリ | 103,552 KB |
| 最終ジャッジ日時 | 2024-09-19 00:59:07 |
| 合計ジャッジ時間 | 2,522 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 17 WA * 5 |
ソースコード
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]))
Kazun