ログイン
新規登録
AtsuoCoder Waseda Tour Finals 2025
読込中…
Home
Tasks
Clar
Submissions
Standings
提出 27772814-a1c0-497f-8c6e-bb8f47824d1f
コード
#include<bits/stdc++.h> #include<atcoder/all> using namespace std; using namespace atcoder; using ll=long long; const ll inf=1e18; ll op(ll a,ll b){ return max(a,b); } ll e(){ return -inf; } ll mapping(ll f,ll x){ return f+x; } ll composition(ll f,ll g){ return f+g; } ll id(){ return 0; } int main(){ int n,h,d,l,r,x,a,b; cin>>n; lazy_segtree<ll,op,e,ll,mapping,composition,id>lseg(n); for(int i=0;i<n;i++){ cin>>h; lseg.set(i,h); } cin>>d; for(int i=0;i<d;i++){ cin>>l>>r>>x>>a>>b; l--,a--; lseg.apply(l,r,x); cout<<lseg.prod(a,b)<<endl; } }
結果
問題
点数
言語
結果
実行時間
メモリ
H - Gardening Diary
150
C++
AC
416 ms
10988 KiB