Implementation
Time Complexity:
C++
#include <bits/stdc++.h>using namespace std;using ll = long long;class LazySegtree {private:static constexpr array<ll, 2> ID = {0, INT32_MAX}; // default tree valuestatic constexpr int LZ_ID = 0; // default lazy valueconst int sz;vector<array<ll, 2>> t; // t[v] = {sum, minimum}
Join the USACO Forum!
Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!