版本比较
一些乱七八糟的板子(已封装)
正文
增加 6 行删除 7 行
11234567789101145 行未改动5758596061616263646512 行未改动787980818283828384858641 行未改动12812913013113313213313413513634 行未改动171172173174176175176177178179377 行未改动全部展开###### 上次更新时间:2025/12/19 记得点右上角的更新按钮更新 awa。###### 上次更新时间:2026/2/25 记得点右上角的更新按钮更新 awa。>本帖会不断更新&分类### SegTree```cppnamespace SegTree {#define inf 1e18 const int maxn = 2e5 + 10; const int maxn = /*your size*/; struct Tree { int tr[maxn * 4], lz[maxn * 4], a[maxn]; void push_up(int x) { tr[x] = tr[x * 2] + tr[x * 2 + 1];45 行未改动```### BitTree```cppnamespace BitTree { const int maxn = /*your bitree size*/; const int maxn = /*your size*/; int lowbit(int x) { return x & -x; } struct tree {12 行未改动```### Block```cppnamespace Block { //const int maxn = /*your size*/; const int maxn_ = 500; const int maxn = /*your size*/; struct block { int st[maxn_], ed[maxn_], sum[maxn_], add[maxn_]; int pos[maxn], a[maxn]; int n;41 行未改动```### LCA```cppnamespace LCA { const int maxn = 500010; const int maxn = /*your size*/; int dep[maxn], fa[maxn][20]; void dfs(int u) { if (u == 0) { dep[u] = 0;34 行未改动```### 矩阵快速幂```cppnamespace Matrix { const int maxn = 2, mod = 1e9 + 7; const int maxn = /*your size*/, mod = 1e9 + 7; struct matrix { int a[maxn][maxn]; void clear() { memset(a, 0, sizeof(a));377 行未改动全部展开