#include using namespace std; #if __has_include("all.hpp") #include "all.hpp" #else #include #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--; vectora(n); if(b==2)b=1; else b=0; for(int i=0;i>a[i]; vector v(n+1, 0); lazy_segtree seg(v); for(int i=0;i