結果
| 問題 | No.3760 Streaming Schedule |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-10-09 23:02:56 |
| 言語 | C++23 (gcc 15.3.0 + boost 1.92.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 218 ms / 2,000 ms |
| + 508µs | |
| コード長 | 1,040 bytes |
| 記録 | |
| コンパイル時間 | 3,930 ms |
| コンパイル使用メモリ | 379,868 KB |
| 実行使用メモリ | 20,424 KB |
| 最終ジャッジ日時 | 2026-10-09 23:03:06 |
| 合計ジャッジ時間 | 9,069 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 47 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#if __has_include("all.hpp")
#include "all.hpp"
#else
#include <atcoder/all>
#endif
using namespace atcoder;
//遅延セグ木・区間更新・区間最大テンプレ
using S = long long;
using F = long long;
S op(S a, S b){ return max(a, b); }
//データとデータの演算
S e(){ return 0; }
//初期値(データ)
S mapping(F f, S x){ return f+x; }
//データと演算子の演算
F composition(F f, F g){ return f+g;}
//演算子と演算子の演算
F id(){ return 0; }
//初期値(演算子)
int main(void){
int n,b,c;
cin>>n>>b>>c;
c--;
vector<long long>a(n);
if(b==2)b=1;
else b=0;
for(int i=0;i<n;i++)cin>>a[i];
vector<S> v(n+1, 0);
lazy_segtree<S, op, e, F, mapping, composition, id> seg(v);
for(int i=0;i<n;i++){
seg.set(i+1,seg.prod(max(0,i-c),i+1-b));
seg.apply(max(0,i-c),i+1,a[i]);
//for(int j=0;j<=n;j++)cout<<seg.get(j)<<(j==n?"\n":" ");
}
cout<<seg.prod(max(0,n-c),n+1)<<endl;
return 0;
}