結果
問題 |
No.921 ずんだアロー
|
ユーザー |
![]() |
提出日時 | 2019-11-08 21:50:05 |
言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
結果 |
WA
|
実行時間 | - |
コード長 | 309 bytes |
コンパイル時間 | 80 ms |
コンパイル使用メモリ | 12,544 KB |
実行使用メモリ | 24,472 KB |
最終ジャッジ日時 | 2024-09-15 01:25:02 |
合計ジャッジ時間 | 2,880 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 17 WA * 5 |
ソースコード
N=int(input()) A=list(map(int,input().split())) A.append("?") NOW=-1 count=0 LIST=[] for a in A: if NOW==a: count+=1 else: LIST.append((NOW,count)) NOW=a count=1 DP=[0]*len(LIST) for i in range(1,len(LIST)): DP[i]=max(DP[i-1],DP[i-2]+LIST[i][1]) print(max(DP))