Language: C++

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

#ifdef DEBUG
#include <Mylib/Debug/debug.cpp>
#else
#define dump(...) ((void)0)
#endif

template <typename T, typename U>
bool chmin(T &a, const U &b){
  return (a > b ? a = b, true : false);
}

template <typename T, typename U>
bool chmax(T &a, const U &b){
  return (a < b ? a = b, true : false);
}

template <typename T, size_t N, typename U>
void fill_array(T (&a)[N], const U &v){
  std::fill((U*)a, (U*)(a + N), v);
}

template <typename T, size_t N, size_t I = N>
auto make_vector(const std::array<int, N> &a, T value = T()){
  static_assert(I >= 1);
  static_assert(N >= 1);
  if constexpr (I == 1){
    return std::vector<T>(a[N - I], value);
  }else{
    return std::vector(a[N - I], make_vector<T, N, I - 1>(a, value));
  }
}

template <typename T>
std::ostream& operator<<(std::ostream &s, const std::vector<T> &a){
  for(auto it = a.begin(); it != a.end(); ++it){
    if(it != a.begin()) s << " ";
    s << *it;
  }
  return s;
}

template <typename T>
std::istream& operator>>(std::istream &s, std::vector<T> &a){
  for(auto &x : a) s >> x;
  return s;
}

/**
 * @title Range affine / Range sum
 * @docs affine_sum.md
 */
namespace haar_lib {
  template <typename T, typename U>
  struct affine_sum {
    using value_type_get = T;
    using value_type_update = std::pair<U, U>;

    value_type_get id_get() const {return 0;}
    value_type_update id_update() const {return {1, 0};}

    value_type_get op_get(value_type_get a, value_type_get b) const {return a + b;}
    value_type_update op_update(value_type_update a, value_type_update b) const {return {a.first * b.first, a.first * b.second + a.second};}

    value_type_get op(value_type_get a, value_type_update b, int len) const {
      return b.first * a + b.second * len;
    }
  };
}




namespace atcoder {}

namespace solver {
  using namespace haar_lib;
  namespace ac = atcoder;

  void init(){
    std::cin.tie(0);
    std::ios::sync_with_stdio(false);
    std::cout << std::fixed << std::setprecision(12);
    std::cerr << std::fixed << std::setprecision(12);
    std::cin.exceptions(std::ios_base::failbit);
  }

  using mint = ac::modint998244353;
  using pmm = std::pair<mint, mint>;
  const static affine_sum<mint, mint> M;

  mint op(mint l, mint r){return M.op_get(l, r);}
  mint e(){return M.id_get();}
  auto mapping(pmm l, mint r){return M.op(r, l, 1);}
  auto composition(pmm l, pmm r){return M.op_update(l, r);}
  auto id(){return M.id_update();}

  void solve(){
    int N, Q; std::cin >> N >> Q;
    std::vector<mint> a(N);
    for(int i = 0; i < N; ++i){
      int x; std::cin >> x;
      a[i] = mint::raw(x);
    }


    auto seg = ac::lazy_segtree<mint, op, e, pmm, mapping, composition, id>(a);

    for(int i = 0; i < Q; ++i){
      int type; std::cin >> type;

      if(type == 0){
        int l, r, b, e; std::cin >> l >> r >> b >> e;
        seg.apply(l, r, std::make_pair(b, e));
      }else{
        int l, r; std::cin >> l >> r;
        std::cout << seg.prod(l, r).val() << "\n";
      }
    }
  }
}

int main(){
  solver::init();
  while(true){
    try{
      solver::solve();
    }catch(const std::istream::failure &e){
      break;
    }
  }
  return 0;
}


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