criyle/codenet-compile-errors huggingface dataset:
Language: C++

#ifndef ATCODER_SEGTREE_HPP
#define ATCODER_SEGTREE_HPP 1

#include <algorithm>
#include <atcoder/internal_bit>
#include <cassert>
#include <vector>

namespace atcoder {

template <class S, S (*op)(S, S), S (*e)()> struct segtree {
  public:
    segtree() : segtree(0) {}
    segtree(int n) : segtree(std::vector<S>(n, e())) {}
    segtree(const std::vector<S>& v) : _n(int(v.size())) {
        log = internal::ceil_pow2(_n);
        size = 1 << log;
        d = std::vector<S>(2 * size, e());
        for (int i = 0; i < _n; i++) d[size + i] = v[i];
        for (int i = size - 1; i >= 1; i--) {
            update(i);
        }
    }

    void set(int p, S x) {
        assert(0 <= p && p < _n);
        p += size;
        d[p] = x;
        for (int i = 1; i <= log; i++) update(p >> i);
    }

    S get(int p) {
        assert(0 <= p && p < _n);
        return d[p + size];
    }

    S prod(int l, int r) {
        assert(0 <= l && l <= r && r <= _n);
        S sml = e(), smr = e();
        l += size;
        r += size;

        while (l < r) {
            if (l & 1) sml = op(sml, d[l++]);
            if (r & 1) smr = op(d[--r], smr);
            l >>= 1;
            r >>= 1;
        }
        return op(sml, smr);
    }

    S all_prod() { return d[1]; }

    template <bool (*f)(S)> int max_right(int l) {
        return max_right(l, [](S x) { return f(x); });
    }
    template <class F> int max_right(int l, F f) {
        assert(0 <= l && l <= _n);
        assert(f(e()));
        if (l == _n) return _n;
        l += size;
        S sm = e();
        do {
            while (l % 2 == 0) l >>= 1;
            if (!f(op(sm, d[l]))) {
                while (l < size) {
                    l = (2 * l);
                    if (f(op(sm, d[l]))) {
                        sm = op(sm, d[l]);
                        l++;
                    }
                }
                return l - size;
            }
            sm = op(sm, d[l]);
            l++;
        } while ((l & -l) != l);
        return _n;
    }

    template <bool (*f)(S)> int min_left(int r) {
        return min_left(r, [](S x) { return f(x); });
    }
    template <class F> int min_left(int r, F f) {
        assert(0 <= r && r <= _n);
        assert(f(e()));
        if (r == 0) return 0;
        r += size;
        S sm = e();
        do {
            r--;
            while (r > 1 && (r % 2)) r >>= 1;
            if (!f(op(d[r], sm))) {
                while (r < size) {
                    r = (2 * r + 1);
                    if (f(op(d[r], sm))) {
                        sm = op(d[r], sm);
                        r--;
                    }
                }
                return r + 1 - size;
            }
            sm = op(d[r], sm);
        } while ((r & -r) != r);
        return 0;
    }

  private:
    int _n, size, log;
    std::vector<S> d;

    void update(int k) { d[k] = op(d[2 * k], d[2 * k + 1]); }
};

}  // namespace atcoder

#endif  // ATCODER_SEGTREE_HPP


Compiler output:
a.cc:5:10: fatal error: atcoder/internal_bit: No such file or directory
    5 | #include <atcoder/internal_bit>
      |          ^~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
#include <atcoder/all>
using namespace atcoder;
#define ll long long
#define ld long double
#define REP(i,m,n) for(int i=(int)(m); i<(int)(n); i++)
#define rep(i,n) REP(i,0,n)
#define RREP(i,m,n) for(int i=(int)(m); i>=(int)(n); i--)
#define rrep(i,n) RREP(i,(n)-1,0)
#define all(v) v.begin(), v.end()
#define endk '\n'
const int inf = 1e9+7;
const ll longinf = 1LL<<60;
const ll mod = 1e9+7;
const ld eps = 1e-10;
template<typename T1, typename T2> inline void chmin(T1 &a, T2 b){if(a>b) a=b;}
template<typename T1, typename T2> inline void chmax(T1 &a, T2 b){if(a<b) a=b;}

ll e() {
  return -1;
}
ll op(ll n, ll m) {
  return max(n, m);
}
int main() {
  cin.tie(0);
  ios::sync_with_stdio(false);
  int n, q; cin >> n >> q;
  vector<ll> A(n); rep(i, n) cin >> A[i];
  segtree<ll, op, e> seg(A);
  rep(_, q) {
    int t; cin >> t;
    if(t == 1) {
      int x; ll v;
      cin >> x >> v;
      x--;
      seg.set(x, v);
    } else if(t == 2) {
      int l, r;
      cin >> l >> r;
      l--;
      cout << seg.prod(l, r) << endk;
    } else {
      int x; ll v;
      cin >> x >> v;
      x--;
      cout << seg.max_right(x, [&](ll u) { return v > u; }) + 1 << endk;
    }
  }
  return 0;
}


Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
#include <utility>
#include <tuple>
#include <cstdint>
#include <cstdio>
#include <map>
#include <queue>
#include <set>
#include <stack>
#include <deque>
#include <unordered_map>
#include <unordered_set>
#include <bitset>
#include <cctype>
#include <numeric>
#include <cmath>
#include <iomanip> //cout << fixed << setprecision(15) << << endl;
#include <cassert>
#include "atcoder/segtree"

#define ll long long int
#define pb push_back
#define rep(i,n) for(int i=0;i<(n);i++)
#define REP(i,n) for(int i=1;i<=(n);i++)
using namespace std;
using namespace atcoder;

int mx8[] = {0,0,1,-1,-1,1,-1,1};
int my8[] = {-1,1,0,0,-1,-1,1,1};
int mx4[] = {1,-1,0,0};
int my4[] = {0,0,-1,1};
const int MOD = 1000000007;
ll op(ll a, ll b) {
    return max(a, b);
}
ll e() {
    return -1;
}

int v;
bool f(ll x){
    return v > x;
}

int main(){
    int n, q;
    cin >> n >> q;
    vector<ll> a(n);
    rep(i,n) cin >> a[i];

    segtree<ll, op, e> seg(a);
    while(q--){
        int t; cin >> t;
        if(t==1)
        {
            int X,V; cin >> X >> V;
            X--;
            seg.set(X,V);
        }
        else if(t == 2)
        {
            int l, r; cin >> l >> r;
            l--;
            cout << seg.prod(l,r) << endl;
        }
        else
        {
            ll X; cin >> X >> v;
            X--;
            cout << seg.max_right<f>(X) + 1<< endl;
        }
    }

}

Compiler output:
a.cc:22:10: fatal error: atcoder/segtree: No such file or directory
   22 | #include "atcoder/segtree"
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/segtree>
#include <iostream>
#include <vector>
#define rep(i, n) for (int i = 0; i < (n); i++)
using namespace std;

int op(int a, int b) { return max(a, b); }
int e() { return -1L; }

int V;
bool f(int a) { return a < V; }

int main(void) {
  ios::sync_with_stdio(false);
  int N, Q;
  cin >> N >> Q;
  vector<int> A(N);
  rep(i, N) { cin >> A[i]; }
  atcoder::segtree<int, op, e> seg(A);

  rep(i, Q) {
    int T;
    cin >> T;
    if (T == 1) {
      int X;
      int V;
      cin >> X >> V;
      X--;
      seg.set(X, V);
    } else if (T == 2) {
      int L, R;
      cin >> L >> R;
      L--;
      int answer = seg.prod(L, R);
      cout << answer << endl;
    } else {
      int X;
      cin >> X >> V;
      X--;
      int answer = seg.max_right<f>(X) + 1;
      cout << answer << endl;
    }
  }
  return 0;
}


Compiler output:
a.cc:1:10: fatal error: atcoder/segtree: No such file or directory
    1 | #include <atcoder/segtree>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include "/opt/atcoder-stl/atcoder/segtree.hpp"
#include <cstdio>
#include <vector>

using namespace std;
using namespace atcoder;

int op(int a, int b) { return max(a, b); }

int e() { return -1; }

int target;

bool f(int v) { return v < target; }

int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &(a[i]));
    }

    segtree<int, op, e> seg(a);

    for (int i = 0; i < q; i++) {
        int t;
        scanf("%d", &t);
        if (t == 1) {
            int x, v;
            scanf("%d %d", &x, &v);
            x--;
            seg.set(x, v);
        } else if (t == 2) {
            int l, r;
            scanf("%d %d", &l, &r);
            l--;
            printf("%d\n", seg.prod(l, r));
        } else if (t == 3) {
            int p;
            scanf("%d %d", &p, &target);
            p--;
            printf("%d\n", seg.max_right<f>(p) + 1);
        }
    }
}


Compiler output:
a.cc:1:10: fatal error: /opt/atcoder-stl/atcoder/segtree.hpp: No such file or directory
    1 | #include "/opt/atcoder-stl/atcoder/segtree.hpp"
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include </opt/atcoder-stl/atcoder/segtree>
#include <cstdio>
#include <vector>

using namespace std;
using namespace atcoder;

int op(int a, int b) { return max(a, b); }

int e() { return -1; }

int target;

bool f(int v) { return v < target; }

int main() {
    int n, q;
    scanf("%d %d", &n, &q);
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &(a[i]));
    }

    segtree<int, op, e> seg(a);

    for (int i = 0; i < q; i++) {
        int t;
        scanf("%d", &t);
        if (t == 1) {
            int x, v;
            scanf("%d %d", &x, &v);
            x--;
            seg.set(x, v);
        } else if (t == 2) {
            int l, r;
            scanf("%d %d", &l, &r);
            l--;
            printf("%d\n", seg.prod(l, r));
        } else if (t == 3) {
            int p;
            scanf("%d %d", &p, &target);
            p--;
            printf("%d\n", seg.max_right<f>(p) + 1);
        }
    }
}


Compiler output:
a.cc:1:10: fatal error: /opt/atcoder-stl/atcoder/segtree: No such file or directory
    1 | #include </opt/atcoder-stl/atcoder/segtree>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++



#include <bits/stdc++.h>
//#include "bits/stdc++.h"
#include <atcoder/all>

using namespace std;
using namespace atcoder;
typedef long long ll;

/*
#define i_7 (ll)(1E9+7)
//#define i_7 998244353
#define i_5 i_7-2
ll mod(ll a){
    ll c=a%i_7;
    if(c>=0)return c;
    return c+i_7;
}
void Add(ll &pos,ll val){pos=mod(pos+val);}
void mod_print(ll k){
    ll P=50000;
    rep(y,1,P){
        ll x=mod(y*k);
        
        if(abs(x)<=P||x+P>=i_7){
            if(x+P>=i_7){
                x-=i_7;
            }
            cout<<x<<"/"<<y<<endl;
            //cout<<setprecision(5)<<(dd)x/(dd)y;
            return;
        }
    }
    cout<<"nun"<<endl;
}
*/

#include "boost/multiprecision/cpp_int.hpp"
#include "boost/multiprecision/cpp_dec_float.hpp"
namespace mp = boost::multiprecision;
typedef mp::cpp_int LL;
typedef mp::number<mp::cpp_dec_float<1024>> DD;// 仮数部が1024ビットの浮動小数点数型(TLEしたら小さくする)

typedef long double dd;
typedef pair<ll,ll> l_l;
typedef pair<dd,dd> d_d;
ll inf=(ll)1E16;
#define rep(i,l,r) for(ll i=l;i<=r;i++)
#define rrep(i,r,l) for(ll i=r;i>=l;i--)
#define pb push_back
ll max(ll a,ll b){if(a<b)return b;else return a;}
ll min(ll a,ll b){if(a>b)return b;else return a;}
void Max(ll &pos,ll val){pos=max(pos,val);}//Max(dp[n],dp[n-1]);
void Min(ll &pos,ll val){pos=min(pos,val);}
dd EPS=1E-12;
#define fastio ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
#define fi first
#define se second

#define SORT(v) sort(v.begin(),v.end())
#define ERASE(v) v.erase(unique(v.begin(),v.end()),v.end())
#define POSL(v,x) (lower_bound(v.begin(),v.end(),x)-v.begin())
#define POSU(v,x) (upper_bound(v.begin(),v.end(),x)-v.begin())
template<class T,class S>
inline bool chmax(T &a, S b) {
    if(a < b) {
        a = b;
        return true;
    }
    return false;
}
template<class T,class S>
inline bool chmin(T &a, S b) {
    if(a > b) {
        a = b;
        return true;
    }
    return false;
}
#define endl "\n"  //インタラクティブで消す！！！！！！！！！！！！！！！！！！！！！
#define all(c) c.begin(),c.end()
typedef vector<ll> vl;


//using mint = modint998244353;
using mint = modint1000000007;
//////////////////////////


ll OP(ll a,ll b){return max(a,b);}
ll E(){return -inf;}
ll target;
bool F(ll x){
    if(target>x)return true;
    return false;
}

int main(){fastio
    ll n,q;cin>>n>>q;
    vl a(n+1);rep(i,1,n)cin>>a[i];
    segtree<ll,OP,E>seg(a);
    while(q--){
        ll t,x,y;cin>>t>>x>>y;
        if(t==1){
            seg.set(x,y);
        }else if(t==2){
            cout<<seg.prod(x,y+1)<<endl;
        }else{
            target=y;
            cout<<seg.max_right<F>(x)<<endl;
        }
    }
    
    
    return 0;
}


Compiler output:
a.cc:5:10: fatal error: atcoder/all: No such file or directory
    5 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/segtree>
#include <cstdio>
#include <vector>

using namespace std;
using namespace atcoder;

int target;

int main() {

    auto op = [](int a, int b){ return max(a, b); };

    auto e = []{ return -1; };

    auto f = [](int v){ return v < target; };

    int n, q;
    scanf("%d %d", &n, &q);
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &(a[i]));
    }

    segtree<int, op, e> seg(a);

    for (int i = 0; i < q; i++) {
        int t;
        scanf("%d", &t);
        if (t == 1) {
            int x, v;
            scanf("%d %d", &x, &v);
            x--;
            seg.set(x, v);
        } else if (t == 2) {
            int l, r;
            scanf("%d %d", &l, &r);
            l--;
            printf("%d\n", seg.prod(l, r));
        } else if (t == 3) {
            int p;
            scanf("%d %d", &p, &target);
            p--;
            printf("%d\n", seg.max_right<f>(p) + 1);
        }
    }
}


Compiler output:
a.cc:1:10: fatal error: atcoder/segtree: No such file or directory
    1 | #include <atcoder/segtree>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/segtree>
#include <cstdio>
#include <vector>

using namespace std;
using namespace atcoder;

int main() {

    auto op = [](int a, int b){ return max(a, b); };

    auto e = []{ return -1; };

    int target;

    auto f = [](int v){ return v < target; };

    int n, q;
    scanf("%d %d", &n, &q);
    vector<int> a(n);
    for (int i = 0; i < n; i++) {
        scanf("%d", &(a[i]));
    }

    segtree<int, op, e> seg(a);

    for (int i = 0; i < q; i++) {
        int t;
        scanf("%d", &t);
        if (t == 1) {
            int x, v;
            scanf("%d %d", &x, &v);
            x--;
            seg.set(x, v);
        } else if (t == 2) {
            int l, r;
            scanf("%d %d", &l, &r);
            l--;
            printf("%d\n", seg.prod(l, r));
        } else if (t == 3) {
            int p;
            scanf("%d %d", &p, &target);
            p--;
            printf("%d\n", seg.max_right<f>(p) + 1);
        }
    }
}


Compiler output:
a.cc:1:10: fatal error: atcoder/segtree: No such file or directory
    1 | #include <atcoder/segtree>
      |          ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace atcoder;
#define rep(i, n) for (ll i = 0; i < (ll)(n); ++i)
#define rep2(i, s, n) for (ll i = s; i < (ll)(n); i++)
#define repr(i, n) for (ll i = n; i >= 0; i--)
#define pb push_back
#define COUT(x) cout << (x) << "\n"
#define COUTF(x) cout << setprecision(15) << (x) << "\n"
#define ENDL cout << "\n"
#define DF(x) x.erase(x.begin())
#define ALL(x) x.begin(), x.end()
#define SORT(x) sort(ALL(x))
#define RSORT(x) sort(x.rbegin(), x.rend())
#define REVERSE(x) reverse(ALL(x))
#define MAX(x) *max_element(ALL(x))
#define MAXI(x) max_element(ALL(x)) - x.begin()
#define SUM(x) accumulate(ALL(x), 0)
#define COUNT(x, y) count(ALL(x), y);
#define ANS cout << ans << "\n"
#define YES cout << "YES\n";
#define NO cout << "NO\n";
#define Yes cout << "Yes\n";
#define No cout << "No\n";
#define YN YES else NO
#define yn Yes else No
#define init() \
  cin.tie(0);  \
  ios::sync_with_stdio(false)
#define LINE cerr << "[debug] line: " << __LINE__ << "\n";
#define debug(x) cerr << "[debug] " << #x << ": " << x << "\n";
#define debugV(v)                       \
  cerr << "[debugV] " << #v << ":";     \
  rep(z, v.size()) cerr << " " << v[z]; \
  cerr << "\n";
using namespace std;
using ll = long long;
using ld = long double;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using mll = map<ll, ll>;
using qll = queue<ll>;
using P = pair<ll, ll>;
using vp = vector<P>;
using vs = vector<string>;

template <typename T>
inline istream& operator>>(istream& i, vector<T>& v) {
  rep(j, v.size()) i >> v[j];
  return i;
}

template <typename T1, typename T2>
inline istream& operator>>(istream& i, pair<T1, T2>& v) {
  return i >> v.first >> v.second;
}

constexpr ll INF = 0x3f3f3f3f3f3f3f3f;
constexpr ld PI = 3.141592653589793238462643383279;
ll get_digit(ll x) {
  return to_string(x).size();
}

ll gcd(ll x, ll y) {
  return y ? gcd(y, x % y) : x;
}

ll lcm(ll a, ll b) {
  return a / gcd(a, b) * b;
}

template <class T>
bool chmax(T& a, const T& b) {
  if (a < b) {
    a = b;
    return 1;
  }
  return 0;
}

template <class T>
bool chmin(T& a, const T& b) {
  if (b < a) {
    a = b;
    return 1;
  }
  return 0;
}

ll op(ll a, ll b) {
  return max(a, b);
}

ll e() {
  return 0;
}

int target;
bool f(ll x) {
  return x <= target;
}

signed main() {
  init();
  ll N, Q;
  cin >> N >> Q;

  segtree<ll, op, e> seg(N);

  rep(i, N) {
    ll a;
    cin >> a;
    seg.set(i, a);
  }
  rep(i, Q) {
    ll t, l, r;
    cin >> t >> l >> r;
    l--;
    r--;

    if (t == 1) seg.set(l, r);
    if (t == 2) COUT(seg.prod(l, r));
    if (t == 3) {
      target = r;
      COUT(seg.max_right<f>(l) + 1);
    }
  }

  return 0;
}

Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
using namespace std;
#define rep(i,n) for(int i = 0; i < (n);i++)
#define sz(x) int(x.size())
typedef long long ll;
typedef long double ld;
typedef pair<int,int> P;
template <typename T> 
struct SegmentTree {
  
  int n;
  vector<T> node;

  T f(T a, T b) {return max(a, b);}
  void g(T &a, T b) {a = b;}

  SegmentTree (int sz, T init = 0) {
    n = 1; while (n < sz) n <<= 1;
    node.assign(2*n, init);
    for (int i = n - 2; i >= 0; i--) node[i] = f(node[2*i+1], node[2*i+2]);
  }

  void update(int k, T x) {
    k += (n - 1);
    g(node[k], x);
    while (k > 0) {
      k = (k - 1) >> 1;
      node[k] = f(node[2*k+1], node[2*k+2]);
    } 
  }

  T query(int a, int b, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    if (r <= a || b <= l) return 0;
    if (a <= l && r <= b) return node[k];
    T vl = query(a, b, 2*k+1, l, (l+r)/2);
    T vr = query(a, b, 2*k+2, (l+r)/2, r);
    return f(vl, vr);
  }

  T getvalue(int k) {
    return query(k,k+1);
  }

  template <typename F> 
  int find (int a, int b, T x, F &ok, int k = 0, int l = 0, int r = -1) {
    if (r < 0) r = n;
    if (l + 1 == r) return (ok(node[k]) ? k - n + 1 : b);
    if (!ok(node[k]) || r <= a || b <= l) return b;
    int vl = find(a, b, x, ok, 2*k+1, l, (l + r)/2);
    if (vl != b) return vl;
    return find(a, b, x, ok, 2*k+2, (l + r)/2, r);
  }
 
};
int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n, q;
  cin >> n >> q;
  SegmentTree<int> seg(n);
  rep(i,n) {
    int a;
    cin >> a;
    seg.update(i, a);
  }
  while (q--) {
    int t;
    cin >> t;
    if (t == 1) {
      int x, v;
      cin >> x >> v; x--;
      seg.update(x, v);
    } else if (t == 2) {
      int l, r;
      cin >> l >> r; l--;
      
      cout << seg.query(l, r) << "\n";
    } else {
      int x, v;
      cin >> x >> v; x--;
      /*
      auto ok = [&](int a) {return a >= v;};
      cout << seg.find(x, n, v, ok) + 1 << "\n";
      */
      int l = x, r = n + 1;
      while (r - l > 1) {
        int m = (r + l) / 2;
        if (seg.query(x, m) >= v) r = m;
        else l = m;
      }
      cout << r << "\n;
    }
  }
  return 0; 
}


Compiler output:
a.cc:92:20: warning: missing terminating " character
   92 |       cout << r << "\n;
      |                    ^
a.cc:92:20: error: missing terminating " character
   92 |       cout << r << "\n;
      |                    ^~~~
a.cc: In function 'int main()':
a.cc:93:5: error: expected primary-expression before '}' token
   93 |     }
      |     ^
Language: C++

#include<bits/stdc++.h>
using namespace std;
using LL = long long;
using ULL = unsigned long long;
#define rep(i,n) for(int i=0; i<(n); i++)

struct RQ {
 using RQV = LL;
 using RQRV = LL;
 static RQV Zero(){ return 0; }
 static RQRV RZero(){ return 0; }
 // addition
 static RQV f(RQV a,RQV b){ return max(a,b); }
 // update function
 static void uf(RQV& a,RQV b){ a = b; }
 // effect of range queries n-sized
 static void ef(RQV& a,RQRV b,int n){  }
 // range query update
 static void ruf(RQRV& a,RQRV b){  }
 // comparation
 static bool cmp(RQV l,RQV r){ return l<=r; }
 struct Node{
  RQV v; RQRV r;
 };
 int N;
 vector<Node> V;

 void init(int n){
  N=1; while (N<n) N*=2;
  V.assign(N*2,{Zero(),RZero()});
 }

 void spread(int i,int z){
  if (z!=1) {
   ef(V[i*2].v,V[i].r,z/2);
   ruf(V[i*2].r,V[i].r);
   ef(V[i*2+1].v,V[i].r,z/2);
   ruf(V[i*2+1].r,V[i].r);
  }
  V[i].r = RZero();
 }

 void upd(int p,RQV v){
  for(int d=N; d>=1; d/=2) spread(p/d,d);
  p+=N; uf(V[p].v,v);
  int z=1;
  while(p!=1){
   p/=2; z*=2;
   V[p].v = f(V[p*2].v,V[p*2+1].v);
   ef(V[p].v,V[p].r,z);
  }
 }

 void updr(int l,int r,RQRV v,int a=0,int b=0,int i=-1){
  if(i==-1){ a=0; b=N; i=1; }
  spread(i,b-a);
  if(r<=a || b<=l) return;
  if(l<=a && b<=r){
   ruf(V[i].r,v);
   ef(V[i].v,V[i].r,b-a);
   return;
  }
  updr(l,r,v,a,(a+b)/2,i*2);
  updr(l,r,v,(a+b)/2,b,i*2+1);
  V[i].v = f(V[i*2].v,V[i*2+1].v);
  ef(V[i].v,V[i].r,b-a);
 }

 RQV query(int l,int r,int a=0,int b=0,int i=-1){
  if(i==-1){ a=0; b=N; i=1; }
  if(r<=a || b<=l) return Zero();
  if(l<=a && b<=r) return V[i].v;
  RQV q1 = query(l,r,a,(a+b)/2,i*2);
  RQV q2 = query(l,r,(a+b)/2,b,i*2+1);
  q1 = f(q1,q2);
  ef(q1,V[i].r,min(r,b)-max(l,a));
  return q1;
 }

 int find(int l,RQV v,int a=0,int b=0,int i=-1){
  static RQV x;
  if(i==-1){ a=0; b=N; i=1; x=Zero(); }
  spread(i);
  if(b<=l) return N;
  if(l<=a && !cmp(v,f(x,V[i].v))){ x=f(x,V[i].v); return N; }
  if(b-a==1) return a;
  int q1 = find(l,v,a,(a+b)/2,i*2);
  if(q1!=N) return q1;
  return find(l,v,(a+b)/2,b,i*2+1);
 }
};

int N,Q;
RQ G;

int main(){
 scanf("%d%d",&N,&Q);
 G.init(N);
 rep(i,N){
  int a; scanf("%d",&a);
  G.upd(i,a);
 }
 rep(q,Q){
  int c; scanf("%d",&c);
  if(c==1){
   int x,v; scanf("%d%d",&x,&v); x--;
   G.upd(x,v);
  }
  if(c==2){
   int l,r; scanf("%d%d",&l,&r); l--;
   printf("%lld\n",G.query(l,r));
  }
  if(c==3){
   int x,v; scanf("%d%d",&x,&v); x--;
   printf("%d\n",min(G.find(x,v),N)+1);
  }
 }
 
 return 0;
}


Compiler output:
a.cc: In member function 'int RQ::find(int, RQV, int, int, int)':
a.cc:83:9: error: no matching function for call to 'RQ::spread(int&)'
   83 |   spread(i);
      |   ~~~~~~^~~
a.cc:33:7: note: candidate: 'void RQ::spread(int, int)'
   33 |  void spread(int i,int z){
      |       ^~~~~~
a.cc:33:7: note:   candidate expects 2 arguments, 1 provided
Language: C++

#include<iostream>
#include<vector>
#include<atcoder/segtree>

using namespace std;
using namespace atcoder;

int main(){
  int n,q;
  cin>>n>>q;
  vector<int> a(n);
  for(auto& ai:a)cin>>ai;
  
  using RMQ = segtree<int,[](int a,int b){return a<b?b:a;},[](){return 0;}>;
  RMQ seg(a);
  
  while(q--){
    int t;cin>>t;
    if(t==1){
      int x,v;cin>>x>>v;x--;
      seg.set(x,v);
    }
    if(t==2){
      int l,r;cin>>l>>r;l--;r--;
      cout<<seg.prod(l,r+1)<<endl;
    }
    if(t==3){
      int x,v;cin>>x>>v;x--;
      auto c = [&v](int aj){return v>aj;};
      int res = seg.max_right<c>(x);
      cout<<res+1<<endl;
    }
  }
}


Compiler output:
a.cc:3:9: fatal error: atcoder/segtree: No such file or directory
    3 | #include<atcoder/segtree>
      |         ^~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<iostream>
#include<vector>
#include<atcode/segtree>

using namespace std;
using namespace atcoder;

int main(){
  int n,q;
  cin>>n>>q;
  vector<int> a(n);
  for(auto& ai:a)cin>>ai;
  
  using RMQ = segtree<int,[](int a,int b){return a<b?b:a;},[](){return 0;}>;
  RMQ seg(a);
  
  while(q--){
    int t;cin>>t;
    if(t==1){
      int x,v;cin>>x>>v;x--;
      seg.set(x,v);
    }
    if(t==2){
      int l,r;cin>>l>>r;l--;r--;
      cout<<seg.prod(l,r+1)<<endl;
    }
    if(t==3){
      int x,v;cin>>x>>v;x--;
      auto c = [&v](int aj){return v>aj;};
      int res = seg.max_right<c>(x);
      cout<<res+1<<endl;
    }
  }
}

Compiler output:
a.cc:3:9: fatal error: atcode/segtree: No such file or directory
    3 | #include<atcode/segtree>
      |         ^~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define fs first
#define sc second
#define pb push_back
#define mp make_pair
#define eb emplace_back
#define ALL(A) A.begin(),A.end()
#define RALL(A) A.rbegin(),A.rend()
typedef long long ll;
typedef pair<ll,ll> P;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
template<typename T> T gcd(T a,T b){return b?gcd(b,a%b):a;}
const ll MOD=998244353;
const ll LINF=1ll<<60;
const int INF=1<<30;
int dx[]={1,0,-1,0,1,-1,1,-1};
int dy[]={0,1,0,-1,1,-1,-1,1};

using mint = modint998244353;

struct S{
    mint a;
    int size;
};

struct F{
    mint c, d;
};

S op(S l, S r){
    return S{l.a + r.a, l.size + r.size};
}

S e(){
    return S{0, 0};
}


S mapping(F f, S x){
    return S{x.a * f.c + x.size * f.d, x.size};
}

F composition(F l, F r){
    return F{r.a * l.a, r.b * l.a + l.b};
}

F id(){
    return F{1, 0};
}

int main(){
    int n,q;cin >> n >> q;
    vector<S> a(n);
    for (int i = 0; i < n; i++) {
        int x;cin >> x;
        a[i] = S{x, 1};
    }
    lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);
    while(q--){
        int t;cin >> t;
        if(t == 0){
            int l,r,c,d;cin >> l >> r >> c >> d;
            seg.apply(l, r, F{c, d});
        }
        else{
            int l,r;cin >> l >> r;
            cout << seg.prod(l, r).a.val() << endl;
        }
    }
    return 0;
}


Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/lazysegtree>
#include <iostream>
#include <vector>
using ll = long long;
#define rep(i, j, n) for (int i = j; i < (n); ++i)
using namespace std;

constexpr ll mod = 998244353;

// a <- a * b + c
// a1' + a2' <- (a1 + a2) * b + c + c
// 要素は左の値、右の値の和とcを足す数、つまり要素数を持てばよい
struct X {
  ll sum;
  ll size;
};
struct M {
  ll b, c;
};

X op(X left, X right) {
  return X{(left.sum + right.sum) % mod, (left.size + right.size) % mod};
}
X e() { return X{0, 0}; }

// 要素への作用: 和にbをかけて要素数にcをかける
X mapping(M right, X left) {
  return X{(right.b * left.sum + right.c * left.size) % mod, left.size};
}
// 作用かけたものに作用かけると
// (a * b1 + c1) * b2 + c2
// a * b1 * b2 + c1 * b2 + c2
M composition(M right, M left) {
  return M{right.b * left.b % mod, (left.c * right.b + right.c) % mod};
}
M id() { return M{1, 0}; }

int main() {
  int n, q, t, l, r, b, c;
  cin >> n >> q;
  vector<X> a(n);
  rep(i, 0, n) {
    cin >> t;
    a[i] = X{t, 1};
  }
  atcoder::lazy_segtree<X, op, e, M, mapping, composition, id> st(a);
  rep(i, 0, q) {
    cin >> t >> l >> r;
    if (t)
      cout << st.prod(l, r).sum << '\n';
    else {
      cin >> b >> c;
      st.apply(l, r, M{b, c});
    }
  }
  return 0;
}

Compiler output:
a.cc:1:10: fatal error: atcoder/lazysegtree: No such file or directory
    1 | #include <atcoder/lazysegtree>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
#define rep(i,n) for(int i=0;i<n;i++)
#define rep1(i,n) for(int i=1;i<=n;i++)
#define per(i,n) for(int i=n-1;i>=0;i--)
#define per1(i,n) for(int i=n;i>0;i--)
#define all(v) v.begin(), v.end()
typedef long long ll;
typedef pair<ll,ll> P;
typedef vector<ll> vec;
typedef vector<vec> mat;
using mint=modint998244353;
mint op(mint a,mint b){return a+b;}
mint e(){return 0;}
struct F{mint m,s;};
mint mapping(F f,mint x){return x*f.m+f.s;}
F composition(F f,F g){return F{f.m*g.m,g.s*f.m+f.s};}
F id(){return F{1,0};}
int main(){
    ios::sync_with_stdio(false);
    cin.tie(0);
    int n,q;
    cin>>n>>q;
    vec A(n);
    rep(i,n) cin>>A[i];
    lazy_segtree<mint,op,e,F,mapping,composition,id> B(n);
    rep(i,n) B.set(i,A[i]);
    rep(query,q){
        int x;
        cin>>x;
        if(x==0){
            ll l,r,b,c;
            cin>>l>>r>>b>>c;
            B.apply(l,r,F{b,c});
        }
        else{
            ll l,r;
            cin>>l>>r;
            cout<<B.prod(l,r).val()<<"\n";
        }
    }
}

Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
typedef long long ll;
#define FOR(i, a, n) for (ll i = (ll)a; i < (ll)n; i++)
#define RFOR(i, a, n) for (ll i = (ll)n - 1; i >= (ll)a; i--)
#define rep(i, n) FOR(i, 0, n)
#define rrep(i, n) RFOR(i, 0, n)
#define ALL(v) v.begin(), v.end()
#define bra(first, second) '(' << first << ',' << second << ')'
//constexpr ll MOD = 1000000007;
//constexpr ll MOD = 998244353;
ll INF = 1001001001001001001;
long double EPS = 1e-9;
long double PI = 3.141592653589793238;
template <typename T>
void remove(std::vector<T> &vector, unsigned int index)
{
   vector.erase(vector.begin() + index);
}

using Graph = vector<vector<pair<ll,ll>>>;

// MOD確認
using mint = modint998244353;

struct S {
    mint a;
    int size;
};

struct F {
    mint a, b;
};

S op(S l, S r) { return S{l.a + r.a, l.size + r.size}; }

S e() { return S{0, 0}; }

S mapping(F l, S r) { return S{r.a * l.a + r.size * l.b, r.size}; }

F composition(F l, F r) { return F{r.a * l.a, r.b * l.a + l.b}; }

F id() { return F{1, 0}; }

int main() {
    int n, q;
    scanf("%d %d", &n, &q);

    vector<S> a(n);
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        a[i] = S{x, 1};
    }

    lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);

    for (int i = 0; i < q; i++) {
        int t;
        scanf("%d", &t);
        if (t == 0) {
            int l, r;
            int c, d;
            scanf("%d %d %d %d", &l, &r, &c, &d);
            seg.apply(l, r, F{c, d});
        } else {
            int l, r;
            scanf("%d %d", &l, &r);
            printf("%d\n", seg.prod(l, r).a.val());
        }
    }
}


Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
vector<modint> op(vector<modint> x,vector<modint> y){
  vector<modint> xy(2);
  xy.at(0)=x.at(0)+y.at(0);
  xy.at(1)=x.at(1)+y.at(1);
  return xy;
}
vector<modint> e(){
  vector<modint> x(2);
  x.at(0)=0;
  x.at(1)=0;
  return x;
}
vector<modint> app(vector<modint> f,vector<modint> s){
  vector<modint> fs(2);
  fs.at(0)=f.at(0)*s.at(0)+f.at(1)*s.at(1);
  fs.at(1)=s.at(1);
  return fs;
}
vector<modint> com(vector<modint> f,vector<modint> g){
  vector<modint> fg(2);
  fg.at(0)=f.at(0)*g.at(0);
  fg.at(1)=f.at(0)*g.at(1)+f.at(1);
  return fg;
}
vector<modint> id(){
  vector<modint> f(2);
  f.at(0)=1;
  f.at(1)=0;
  return f;
}
int main(){
  int n,q;
  cin>>n>>q;
  modint::set_mod(998244353);
  vector<vector<modint>> a(n);
  for(int i=0;i<n;i++){
    int x;
    cin>>x;
    a.at(i)={x,1};
  }
  lazy_segtree<vector<modint>,op,e,vector<modint>,app,com,id> ls(a);
  for(int _=0;_<q;_++){
    int t,l,r;
    cin>>t>>l>>r;
    if(t==0){
      int b,c;
      cin>>b>>c;
      ls.apply(l,r,{b,c});
    }
    if(t==1)
      cout<<(ls.prod(l,r)).at(0).val()<<endl;
  }
}

Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#pragma region head
#include <bits/stdc++.h>

#include <atcoder/all>
using namespace atcoder;
using namespace std;
using ll = long long;
using vi = vector<int>;
using vll = vector<ll>;
using pi = pair<int, int>;
using pll = pair<ll, ll>;
template <class T>
using vv = vector<vector<T>>;
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define repi(i, a, b) for (int i = (int)(a); i < (int)(b); i++)
#define rrep(i, n) for (int i = (int)(n)-1; i >= 0; i--)
#define rrepi(i, a, b) for (int i = (int)(b)-1; i >= (int)(a); i--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define bit(n) (1LL << (n))
template <class T>
inline bool chmax(T &a, const T &b) {
    if (a < b) {
        a = b;
        return 1;
    }
    return 0;
}
template <class T>
inline bool chmin(T &a, const T &b) {
    if (a > b) {
        a = b;
        return 1;
    }
    return 0;
}
const int INF = 1002003004;
const ll LINF = 1002003004005006007ll;
struct preprocess {
    preprocess() {
        cin.tie(nullptr);
        ios::sync_with_stdio(false);
        cout << fixed << setprecision(20);
    }
} ____;
#pragma endregion head

#pragma region library
#pragma endregion library
using mint = modint998244353;
using P = pair<mint, int>;
using Q = pair<mint, mint>;

P f(P a, P b) {
    P res;
    res.first = a.first + b.first;
    res.second = a.second + b.second;
    return res;
}
P g(Q x, P a) {
    P res = a;
    res.first *= x.first;
    res.first += x.second * a.second;
    return res;
}
Q h(Q a, Q b) {
    Q res;
    res.first = a.first * b.first;
    res.second = a.first * b.second + a.second;
    return res;
}
P idP() {
    return (P){0, 0};
}
Q idQ() {
    return (Q){1, 0};
}
int main() {
    int n, q;
    cin >> n >> q;
    vi a(n);
    rep(i, n) cin >> a[i];
    lazy_segtree<P, f, idP, Q, g, h, idQ> seg(n);
    rep(i, n) {
        seg.set(i, (P){a[i], 1});
    }
    while (q--) {
        int t;
        cin >> t;
        if (t) {
            int l, r;
            cin >> l >> r;
            cout << seg.prod(l, r).first.val() << '\n';

        } else {
            int l, r, b, c;
            cin >> l >> r >> b >> c;
            seg.apply(l, r, Q{b, c});
        }
    }
}

Compiler output:
a.cc:4:10: fatal error: atcoder/all: No such file or directory
    4 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#pragma GCC optimize("O3")
#include <bits/stdc++.h>
#include <atcoder/all>
#define ll long long
#define rep(i,n) for(ll i=0;i<(n);i++)
#define pll pair<ll,ll>
#define pii pair<int,int>
#define pq priority_queue
#define pb push_back
#define eb emplace_back
#define fi first
#define se second
#define endl '\n'
#define ios ios_base::sync_with_stdio(0),cin.tie(0),cout.tie(0);
#define lb(c,x) distance(c.begin(),lower_bound(all(c),x))
#define ub(c,x) distance(c.begin(),upper_bound(all(c),x))

using namespace std;

using namespace atcoder;

using mint = modint998244353;

struct S{
    mint a;
    int size;
};

struct F{
    mint a,b;
};

S op(S l,S r){
    return S{l.a+r.a,l.size+r.size};
}
S e(){
    return S{0,0};
}
S mapping(F l,S r){
    return S{r.a*l.a+r.size*l.b,r.size};
}
F composition(F l,F r){
    return F{r.a*l.a,r.b*l.a+l.b};
}
F id(){
    return F{1,0};
}
int main(){
    int n,q;
    cin >> n >> q;
    vector<S> a(n);
    rep(i,n){
        int x;
        cin >> x;
        a[i]=S{x,1};
    }
    lazy_segtree<S,op,e,F,mapping,composition,id> seg(a);
    
    rep(i,q){
        int t;
        cin >> t;
        if(t==0){
            int l,r,b,c;
            cin >> l >> r >> b >> c;
            seg.apply(l,r,F{c,d});
            
        }
        if(t==1){
            int l,r;
            cin >> l >> r;
            l--;
            cout << seg.prod(l,r).a.val() << endl;
        }
    }
    return 0;
}

Compiler output:
a.cc:3:10: fatal error: atcoder/all: No such file or directory
    3 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>
using namespace std;
using namespace atcoder;
using ll=long long;
template<class T,class U> inline bool chmin(T&x,U y){if(x>y){x=y;return true;}return false;}
template<class T,class U> inline bool chmax(T&x,U y){if(x<y){x=y;return true;}return false;}
#define fr(i,n) for(int i=0;i<(n);++i)
#define Fr(i,n) for(int i=1;i<=(n);++i)
#define ifr(i,n) for(int i=(n)-1;i>=0;--i)
#define iFr(i,n) for(int i=(n);i>0;--i)
using mint=modint998244353;
using S=pair<mint,int>;
using P=pair<mint,mint>;
S pl(S a,S b){
    return {a.first+b.first,a.second+b.second};
}

S e(){
    return {0,1};
}

S mp(P f,S x){
    return {x.first*f.first+f.second*x.second,x.second};
}

P cp(P f,P g){
    return {f.first*g.first,f.first*g.second+f.second};
}

P id(){
    return {1,0};
}

void solve(){
    int n,q;
    cin>>n>>q;
    vector<S> a;
    a.reserve(n);
    {
        int A;
        fr(i,n) cin>>A,a.emplace_back(A,1);
    }
    lazy_segtree<S,pl,e,P,mp,cp,id> sg(a);
    int t,l,r,b,c;
    fr(_,q){
        cin>>t>>l>>r;
        if(t) cout<<sg.prod(l,r).first.val()<<'\n';
        else{
            cin>>b>>c;
            sg.apply(l,r,make_pair(mint(b),mint(c)));
        }
    }
}

int main(){
    cin.tie(nullptr);
    ios::sync_with_stdio(false);
    solve();
}

Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/lazysegtree>
#include <atcoder/modint>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPR(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(x) ll(x.size()) 
using P = pair<int, int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 2e9;
const ll LINF = (1LL<<60);

using mint = modint998244353;

struct S{
  mint a;
  int size;
};

struct F{
  mint a,b;
};

S op(S l, S r){
  return S{l.a + r.a, l.size + r.size};
}

S e(){
  return S{0, 0};
}

S mapping(F l, S r){
  return S{r.a * l.a + r.size * l.b , r.size};
}

F composition(F l, F r){
  return F{r.a * l.a, r*b * l.a + l.b};
}

F id(){
  return F{1, 0};
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,q; cin >> n >> q;
  vector<S> a(n);
  REP(i,n){
    int x; cin >> x;
    a[i] = S{x, 1};
  }

  lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);

  while(q--){
    int t; cin >> t;
    if(t==0){
      int l,r,c,d;
      cin >> l >> r >> c >> d;
      seg.apply(l, r, F{c, d});
    }else{
      int l,r; cin >> l >> r;
      cout << seg.prod(l, r).a.val() << '\n';
    }
  }

  return 0;
}


Compiler output:
a.cc:1:10: fatal error: atcoder/lazysegtree: No such file or directory
    1 | #include <atcoder/lazysegtree>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/lazysegtree>
#include <atcoder/modint>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPR(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(x) ll(x.size()) 
using P = pair<int, int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 2e9;
const ll LINF = (1LL<<60);

using mint = modint998244353;

struct S{
  mint a;
  int size;
};

struct F{
  mint a,b;
};

S op(S l, S r){
  return S{l.a + r.a, l.size + r.size};
}

S e(){
  return S{0, 0};
}

S mapping(F l, F r){
  return S{r.a * l.a + r.size * l.b , r.size};
}

F composition(F l, F r){
  return F{r.a * l.a, r*b * l.a + l.b};
}

F id(){
  return F{1, 0};
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,q; cin >> n >> q;
  vector<S> a(n);
  REP(i,n){
    int x; cin >> x;
    a[i] = S{x, 1};
  }

  lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);

  while(q--){
    int t; cin >> t;
    if(t==0){
      int l,r,c,d;
      cin >> l >> r >> c >> d;
      seg.apply(l, r, F{c, d});
    }else{
      int l,r; cin >> l >> r;
      cout << seg.prod(l, r).a.val() << '\n';
    }
  }

  return 0;
}


Compiler output:
a.cc:1:10: fatal error: atcoder/lazysegtree: No such file or directory
    1 | #include <atcoder/lazysegtree>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/lazysegtree>
#include <atcoder/modint>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPR(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(x) ll(x.size()) 
using P = pair<int, int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 2e9;
const ll LINF = (1LL<<60);

using mint = modint998244353;

struct S{
  mint a;
  int size;
};

struct F{
  mint a,b;
};

S op(S l, S r){
  return S{l.a + r.a, l.size + r.size};
}

S e(){
  return S{0, 0};
}

S mapping(F l, F r){
  return S{r.a * l.a, r.b * l.a + l.b};
}

F composition(F l, F r){
  return F{r.a * l.a, r*b * l.a + l.b};
}

F id(){
  return F{1, 0};
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,q; cin >> n >> q;
  vector<S> a(n);
  REP(i,n){
    int x; cin >> x;
    a[i] = S{x, 1};
  }

  lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);

  while(q--){
    int t; cin >> t;
    if(t==0){
      int l,r,c,d;
      cin >> l >> r >> c >> d;
      seg.apply(l, r, F{c, d});
    }else{
      int l,r; cin >> l >> r;
      cout << seg.prod(l, r).a.val() << '\n';
    }
  }

  return 0;
}


Compiler output:
a.cc:1:10: fatal error: atcoder/lazysegtree: No such file or directory
    1 | #include <atcoder/lazysegtree>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/lazysegtree>
#include <atcoder/modint>
#include <bits/stdc++.h>
using namespace std;
using namespace atcoder;
typedef long long ll;
#define REP(i, n) for(int i=0; i<n; i++)
#define REPR(i, n) for(int i=n-1; i>=0; i--)
#define FOR(i, m, n) for(int i=m; i<n; i++)
#define ALL(v) v.begin(), v.end()
#define SIZE(x) ll(x.size()) 
using P = pair<int, int>;
template<class T> inline bool chmax(T& a, T b) { if (a < b) { a = b; return 1; } return 0; }
template<class T> inline bool chmin(T& a, T b) { if (a > b) { a = b; return 1; } return 0; }
const int INF = 2e9;
const ll LINF = (1LL<<60);

using mint = modint998244353;

struct S{
  mint a;
  int size;
};

struct F{
  mint a,b;
};

S op(S l, S r){
  return S{l.a + r.a, l.size + r.size};
}

S e(){
  return S{0, 0};
}

S mapping(F l, F r){
  return F{r.a * l.a, r.b * l.a + l.b};
}

F composition(F l, F r){
  return F{r.a * l.a, r*b * l.a + l.b};
}

F id(){
  return F{1, 0};
}

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  int n,q; cin >> n >> q;
  vector<S> a(n);
  REP(i,n){
    int x; cin >> x;
    a[i] = S{x, 1};
  }

  lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);

  while(q--){
    int t; cin >> t;
    if(t==0){
      int l,r,c,d;
      cin >> l >> r >> c >> d;
      seg.apply(l, r, F{c, d});
    }else{
      int l,r; cin >> l >> r;
      cout << seg.prod(l, r).a.val() << '\n';
    }
  }

  return 0;
}


Compiler output:
a.cc:1:10: fatal error: atcoder/lazysegtree: No such file or directory
    1 | #include <atcoder/lazysegtree>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <atcoder/lazysegtree>
#include <atcoder/modint>
#include <cstdio>

using namespace std;
using namespace atcoder;

using mint = modint998244353;

struct S {
    mint a;
    int size;
};

struct F {
    mint a, b;
};

S op(S l, S r) { return S{l.a + r.a, l.size + r.size}; }

S e() { return S{0, 0}; }

S mapping(F l, S r) { return S{r.a * l.a + r.size * l.b, r.size}; }

F composition(F l, F r) { return F{r.a * l.a, r.b * l.a + l.b}; }

F id() { return F{1, 0}; }

int main() {
    int n, q;
    scanf("%d %d", &n, &q);

    vector<S> a(n);
    for (int i = 0; i < n; i++) {
        int x;
        scanf("%d", &x);
        a[i] = S{x, 1};
    }

    lazy_segtree<S, op, e, F, mapping, composition, id> seg(a);

    for (int i = 0; i < q; i++) {
        int t;
        scanf("%d", &t);
        if (t == 0) {
            int l, r;
            int c, d;
            scanf("%d %d %d %d", &l, &r, &c, &d);
            seg.apply(l, r, F{c, d});
        } else {
            int l, r;
            scanf("%d %d", &l, &r);
            printf("%d\n", seg.prod(l, r).a.val());
        }
    }
}


Compiler output:
a.cc:1:10: fatal error: atcoder/lazysegtree: No such file or directory
    1 | #include <atcoder/lazysegtree>
      |          ^~~~~~~~~~~~~~~~~~~~~
compilation terminated.
Language: C++

#include<bits/stdc++.h>
#include<atcoder/all>

using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
using P = pair<int,int>;
#define rep(i,n) for(ll i = 0;i < (ll)n;i++)
#define ALL(x) (x).begin(),(x).end()
#define MOD 1000000007


struct info{
  ll cnt,bit,len;
};

info op(info a,info b){
  ll cnt = a.cnt+b.cnt;
  cnt += (b.len-b.bit)*a.bit;
  return info{cnt,a.bit+b.bit,a.len+b.len};
}
info e(){
  return {0,0,0};
}

info mapping(bool b,info a){
  if(b){
    a.bit = a.len-a.bit;
    a.cnt = (a.len-a.bit)*a.bit-a.cnt;
  }
  return a;
}
bool composition(bool a,bool b){return ((a && b) ? false : (a || b));}
bool id(){return 0;}

int main(){
  
  int n,Q;
  cin >> n >> Q;
  vector<info> v(n,info{0,0,1});
  rep(i,n)cin >> v[i].bit;
  lazy_segtree<info,op,e,bool,mapping,composition,id> seg(v);
  while(Q--){
    int t,l,r;cin >> t >> l >> r;
    if(t == 1){
      seg.apply(--l,r,true);
    }else{
      cout << seg.prod(--l,r).cnt << "\n";
    }
  }


  return 0;
}

Compiler output:
a.cc:2:9: fatal error: atcoder/all: No such file or directory
    2 | #include<atcoder/all>
      |         ^~~~~~~~~~~~~
compilation terminated.
Language: C++

#include <bits/stdc++.h>
#include <atcoder/all>
using namespace std;
using namespace atcoder;
using ll = long long;
using ull = unsigned long long;
#define REP(i,n) for (ll i = 0; i < (n); ++i)
#define RREP(i, n) for (ll i = (n) - 1; i >= 0; --i)
#define ALL(v) (v).begin(), (v).end()
template<class T>
using reverse_priority_queue = priority_queue<T, vector<T>, greater<T>>;

struct S{ ll n0, n1, ninv; };

S op(S l, S r){
    return S{
        l.n0 + r.n0,
        l.n1 + r.n1,
        l.ninv + r.ninv + l.n1 * r.n0
    };
}

S e() { return S{0, 0, 0}; }

using F = bool;  // false = nothing, true = inverse

S mapping(F f, S x){
    if(f){
        return S{x.n1, x.n0, x.n0 * x.n1 - x.ninv};
    }else{
        return x;
    }
}

F composition(F f, F g){ return f != g; }

F id(){ return false; }

int main(){
    ll n, q;
    cin >> n >> q;
    vector<S> a(n);
    REP(i, n){
        ll ai;
        cin >> ai;
        if(ai == 0){
            a.at(i) = S{1, 0, 0};
        }else{
            a.at(i) = S{0, 1, 0};
        }
    }

    lazy_segtree<S, op, e, F, mapping, composition, id> st(a);

    REP(i, q){
        ll t, l, r;
        cin >> t >> l >> r;
        l--; r--;
        if(t == 1){
            st.apply(l, r + 1, true);
        }else{
            cout << st.prod(l, r + 1).ninv << endl;
        }
    }
    return 0;
}


Compiler output:
a.cc:2:10: fatal error: atcoder/all: No such file or directory
    2 | #include <atcoder/all>
      |          ^~~~~~~~~~~~~
compilation terminated.