No.3760 Streaming Schedule
レベル :
/ AI推定難易度 : 1425
/ 実行時間制限 : 1ケース 2.000秒 / メモリ制限
: 1024 MB / 標準ジャッジ問題
タグ : / 解いたユーザー数 54
作問者 :
ei1333333
/ テスター :
kyoprouno
ei13333333
タグ : / 解いたユーザー数 54
作問者 :
ei1333333
/ テスター :
kyoprouno
ei13333333
問題文最終更新日: 2026-10-09 00:24:51
English (AI translation)
This statement was translated by AI (claude-opus-5-5, effort medium) and may contain errors or differ in nuance from the original. The original statement takes precedence.
Back to the original
yukicoder contest 517
(順位表)
の他の問題:
Problem Statement
To prepare for her collaboration live show with Yachiyo, Kaguya has decided to stream for $N$ days in order to gain more fans.
On day $i (1 \leq i \leq N)$, she chooses exactly one of the following.
- Stream. The number of fans increases by $A_i$.
- Rest. The number of fans does not change.
However, both of the following conditions must be satisfied.
- She cannot rest for $B$ or more consecutive days.
- She cannot stream for $C$ or more consecutive days.
Find the maximum number of fans she can gain over the $N$ days.
Constraints
- $1 \leq N \leq 3 \times 10^5$
- $2 \leq B, C \leq N + 1$
- $1 \leq A_i \leq 10^9$
- All input values are integers.
Input
$N$ $B$ $C$ $A_1$ $A_2$ $\cdots$ $A_N$
Output
Output the answer in $1$ line.
Sample
Sample 1
Input
5 2 3 3 10 4 8 6
Output
27
If she streams on days $1, 2, 4, 5$, the total is $3+10+8+6=27$.
Sample 2
Input
7 3 2 5 1 10 4 8 3 7
Output
30
Sample 3
Input
6 7 7 1 1 1 1 1 1
Output
6
提出するには、Twitter 、GitHub、 Googleもしくは右上の雲マークをクリックしてアカウントを作成してください。