結果
| 問題 | No.3760 Streaming Schedule |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-10 00:59:31 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 135 ms / 2,000 ms |
| + 952µs | |
| コード長 | 566 bytes |
| 記録 | |
| コンパイル時間 | 242 ms |
| コンパイル使用メモリ | 81,580 KB |
| 実行使用メモリ | 137,384 KB |
| 最終ジャッジ日時 | 2026-10-10 00:59:37 |
| 合計ジャッジ時間 | 5,671 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
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] + k
else:
u = -(10**18)
if B > 2 or i == 0:
u = max(u, t)
d.append(t - k)
e.append(t - k)
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) + k))