結果

問題 No.3760 Streaming Schedule
コンテスト
ユーザー shogo314
提出日時 2026-10-09 21:51:28
言語 PyPy3
(7.3.23 + ACL)
コンパイル:
pypy3 -mpy_compile _filename_
実行:
pypy3 _filename_
結果
WA  
実行時間 -
コード長 572 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 66 ms
コンパイル使用メモリ 81,464 KB
実行使用メモリ 133,508 KB
最終ジャッジ日時 2026-10-09 21:51:33
合計ジャッジ時間 4,443 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge5_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 40 WA * 7
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from collections import deque

N, B, C = map(int, input().split())
A = list(map(int, input().split()))
t = 0
k = 0
d = deque()
e = deque()
for i, a in enumerate(A):
    if d:
        u = e[0][0] + k
    else:
        u = -(10**18)
    if B > 2:
        u = max(u, t)
    d.append((t - k, i))
    e.append((t - k, i))
    while len(e) >= 2 and e[-2] < e[-1]:
        x = e.pop()
        e.pop()
        e.append(x)
    k += a
    while len(d) >= C:
        x = d.popleft()
        if len(e) > 0 and e[0] == x:
            e.popleft()
    t = u
print(max(t, max(d)[0] + k))
0