結果
| 問題 | No.3760 Streaming Schedule |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-09 23:46:35 |
| 言語 | C++14 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 48 ms / 2,000 ms |
| + 938µs | |
| コード長 | 514 bytes |
| 記録 | |
| コンパイル時間 | 417 ms |
| コンパイル使用メモリ | 95,536 KB |
| 実行使用メモリ | 13,948 KB |
| 最終ジャッジ日時 | 2026-10-09 23:46:41 |
| 合計ジャッジ時間 | 4,054 ms |
|
ジャッジサーバーID (参考情報) |
judge1_1 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
#include<iostream>
#include<cassert>
#include<atcoder/segtree>
using namespace std;
long op(long a,long b){return min(a,b);}
long e(){return(long)1e18;}
int main()
{
ios::sync_with_stdio(false);
cin.tie(nullptr);
int N,B,C;cin>>N>>B>>C;
long sum=0;
atcoder::segtree<long,op,e>seg(N+1);
seg.set(0,0L);
for(int i=0;i<N;i++)
{
int A;cin>>A;
sum+=A;
int l=max(0,i-C+1);
if(B>2||i==0)seg.set(i+1,seg.prod(l,i+1)+A);
else seg.set(i+1,seg.prod(l,i)+A);
}
cout<<sum-seg.prod(max(N-C+1,0),N+1)<<endl;
}