\quad
[ A F O ] \Huge
\color{purple}
\texttt{[ \!\!A \!\!F \!\!O \!\!]} [ A F O ]
\quad
AFO 退役记:https://heldivis.github.io/OI/AFO \large\texttt{AFO 退役记:https://heldivis.github.io/OI/AFO} AFO 退役记: https://heldivis.github.io/OI/AFO
⌈ Heldivis ⌋ \color{#66CCFF}\Huge{\lceil\texttt{Heldivis}\rfloor} ⌈ Heldivis ⌋
为什么不一起做玻璃水母呢? 又柔软,又坚硬, 能够打碎那些无法理解、无法接受、无法原谅的人和事, 又能把无法改变的改变。 \color{#66CCFF}为什么不一起做{玻璃水母}呢?\\又柔软,又坚硬,\\能够打碎那些无法理解、无法接受、无法原谅的人和事,\\又能把无法改变的改变。 为什么不一起做 玻璃水母 呢? 又柔软,又坚硬, 能够打碎那些无法理解、无法接受、无法原谅的人和事, 又能把无法改变的改变。
CodeForces: \textbf{CodeForces:} CodeForces:
Github: \textbf{Github:} Github:
Snippets \Large\quad\\\quad\\\textbf{Snippets} Snippets
VSCode Code Snippets
Time \Large\quad\\\quad\\\textbf{Time} Time
uid | 732379 username | Heldivis 2021-10-16 | \texttt{\ \ \ \ \ \ \ uid\ |} \texttt{\ 732379}\\
\texttt{\ \ username\ |} \texttt{\ Heldivis}\\
\texttt{2021-10-16 |\ } uid | 732379 username | Heldivis 2021-10-16 | 入坑 OI 2022-05-25 | \texttt{OI}\\
\texttt{2022-05-25\ |\ } OI 2022-05-25 | 注册 luogu 2024-06-03 | 红名祭 2024-06-27 | \texttt{ luogu}\\
\texttt{2024-06-03\ |\ }{\small\color{#E74C3C}红名祭}\\
\texttt{2024-06-27\ |\ } luogu 2024-06-03 | 红名祭 2024-06-27 | 打卡 100 天2024-07-25 | 百蓝祭 2024-08-05 | \\
\texttt{2024-07-25\ |\ }{\small{\color{#3498DB}百蓝祭}}\\
\texttt{2024-08-05\ |\ } 2024-07-25 | 百蓝祭 2024-08-05 | 咕值前 500 2024-08-13 | 百绿祭 2024-10-09 | \\
\texttt{2024-08-13\ |\ }{\small\color{#52C41A}百绿祭}\\
\texttt{2024-10-09\ |\ } 2024-08-13 | 百绿祭 2024-10-09 | 打卡 200 天2024-11-05 | 百紫祭 2024-11-11 | \\
\texttt{2024-11-05\ |\ }{\small\color{#9D3DCF}百紫祭}\\
\texttt{2024-11-11\ |\ } 2024-11-05 | 百紫祭 2024-11-11 | 咕值前 100 2024-11-18 | 二百蓝祭 \\
\texttt{2024-11-18\ |\ }{\small\color{#3498DB}二百蓝祭}\\ 2024-11-18 | 二百蓝祭 2024-11-24 | 二百绿祭 2024-11-30 | A F O 2024-12-07 | 百黄祭 \\
\texttt{2024-11-24\ |\ }{\small\color{#52C41A}二百绿祭}\\
\texttt{2024-11-30\ |\ }{\small\color{#66ccff}\\\bold{\mathcal{AFO}}}\\
\texttt{2024-12-07\ |\ }{\small\color{#FFC116}百黄祭}\\
2024-11-24 | 二百绿祭 2024-11-30 | A FO 2024-12-07 | 百黄祭
No RE \Large\quad\\\quad\\\textbf{No RE} No RE
Return 3221226356:Segmentation Fault 访问非法内存。
Return 3221225477:指向空地址(scanf() 没加 &)。
Return 3221225725:死循环 / 数组开过大。
Return 3221225620:除以 0 0 0 。
No WA \Large\quad\\\quad\\\textbf{No WA} No WA
unique() → \to → 之前要 sort()
多测清空 → \to → 别用 memset() 用循环(指没有限制 T T T 限制 ∑ n \sum n ∑ n 的题目)
n ≠ m ≠ k ≠ q ≠ … n \neq m \neq k \neq q \neq \dots n = m = k = q = …
不开 long long 见祖宗
#define int long long → MLE o r TLE \to \text{MLE}\;\;{}_{or}\;\;\text{TLE} → MLE or TLE
int → WA \to \text{WA} → WA
using ll = long long; → CE \to \text{CE} → CE
typedef long long ll; → AC \to \text{AC} → AC
不看 warning 见祖宗:
printf("%d\n", ans);
warning: format ‘%d’ expects argument of type ‘int’, but argument 2 has type ‘long long int’ [-Wformat=] 啥时候能用 std::println("{}", ans); 啊!
n ≤ 10 5 → n\le 10^5\to n ≤ 1 0 5 → 1ll * n * n
头文件
用万能头 → \to → 不能用 y1 max
不用万能头 → \to → 把库写全啊
数据结构
传统线段树 → \to → sgt.Build(n);
分块 → \to → len = sqrt(n); br[Get(n)] = n;
树剖 → \to → Dfs2(...) { dfn[x] = ++dfc, ... }
树状数组 → \to → for (; x < N; x += x & -x) ... for (; x; x -= x & -x) ...
找重儿子(树剖 & DSU on Tree)→ \to → siz[x] = 1;
for (auto i : s) 中 auto 是一个大容器的时候要加 &,否则 TLE \text{TLE} TLE
(res += v) % P → WA \to\ \text{WA} → WA
(res += v) %= P → AC \to\ \text{AC} → AC
std::cout << tmp << '\n'; → WA \to\ \text{WA} → WA
std::cerr << tmp << '\n'; → TLE \to\ \text{TLE} → TLE
// std::cerr << tmp << '\n'; → AC \to\ \text{AC} → AC
char s[N], t[N], n, m; → RE \to\ \text{RE} → RE
char s[N], t[N]; int n, m; → AC \to\ \text{AC} → AC
for(A; B; C) D 中 A 定义的变量如果在 D 中需要有初值需要每次更新。
多测不能在读入时 return puts("-1"), void();。
启发式合并 / 并查集
(如果需要)提前存好 bel[x] / Get(x),防止之后操作修改。
需要再次询问 bel[x] / Get(x) 的不要使用之前的值。
如果维护 siz[x] 要在 Merge(x, y) 时判断 if (fx == fy) {...}
请给快读一个合适的 typename。
对 r / w 使用 ctrl + H 的时候不要把 freopen() 里的替换了。