Essential Algorithm Templates for Competitive Programming
Data Structures
Segment Tree
#include <iostream>
#include <vector>
#include <algorithm>
using namespace std;
typedef long long ll;
const int MAXN = 100010;
int n, m;
vector<ll> arr;
vector<ll> tree;
vector<ll> lazy;
inline ll read() {
ll x = 0, f = 1;
char ch = getchar();
while (ch < '0' || ...
Posted on Tue, 28 Jul 2026 16:49:08 +0000 by Daggeth