跳到正文

Heldivis

732379

2027 届 | AFO|大脑美化了一切 将执念包装成思念与无尽幻觉

在洛谷打开
资料、奖项与版本

资料

编号
732379
抓取

奖项

2024 CSP-S
一等奖
2024 NOIP
一等奖
2023 CSP-S
一等奖
\quad [  ⁣ ⁣A  ⁣ ⁣F  ⁣ ⁣O  ⁣ ⁣]\Huge \color{purple} \texttt{[ \!\!A \!\!F \!\!O \!\!]} \quad

AFO 退役记:https://heldivis.github.io/OI/AFO\large\texttt{AFO 退役记:https://heldivis.github.io/OI/AFO}


⌈Heldivis⌋\color{#66CCFF}\Huge{\lceil\texttt{Heldivis}\rfloor} 为什么不一起做玻璃水母呢?又柔软,又坚硬,能够打碎那些无法理解、无法接受、无法原谅的人和事,又能把无法改变的改变。\color{#66CCFF}为什么不一起做{玻璃水母}呢?\\又柔软,又坚硬,\\能够打碎那些无法理解、无法接受、无法原谅的人和事,\\又能把无法改变的改变。

Atcoder

CodeForces:\textbf{CodeForces:} 

Github:\textbf{Github:} 


Snippets\Large\quad\\\quad\\\textbf{Snippets}

VSCode Code Snippets

Windows\text{Windows} Linux\text{Linux}

Time\Large\quad\\\quad\\\textbf{Time}

       uid | 732379  username | Heldivis2021-10-16 | \texttt{\ \ \ \ \ \ \ uid\ |} \texttt{\ 732379}\\ \texttt{\ \ username\ |} \texttt{\ Heldivis}\\ \texttt{2021-10-16 |\ }入坑 OI2022-05-25 | \texttt{OI}\\ \texttt{2022-05-25\ |\ }注册 luogu2024-06-03 | 红名祭2024-06-27 | \texttt{ luogu}\\ \texttt{2024-06-03\ |\ }{\small\color{#E74C3C}红名祭}\\ \texttt{2024-06-27\ |\ }打卡 100 天2024-07-25 | 百蓝祭2024-08-05 | \\ \texttt{2024-07-25\ |\ }{\small{\color{#3498DB}百蓝祭}}\\ \texttt{2024-08-05\ |\ }咕值前 5002024-08-13 | 百绿祭2024-10-09 | \\ \texttt{2024-08-13\ |\ }{\small\color{#52C41A}百绿祭}\\ \texttt{2024-10-09\ |\ }打卡 200 天2024-11-05 | 百紫祭2024-11-11 | \\ \texttt{2024-11-05\ |\ }{\small\color{#9D3DCF}百紫祭}\\ \texttt{2024-11-11\ |\ }咕值前 1002024-11-18 | 二百蓝祭\\ \texttt{2024-11-18\ |\ }{\small\color{#3498DB}二百蓝祭}\\ 2024-11-24 | 二百绿祭2024-11-30 | AFO2024-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}百黄祭}\\


No RE\Large\quad\\\quad\\\textbf{No RE}

Return 3221226356:Segmentation Fault 访问非法内存。

Return 3221225477:指向空地址(scanf() 没加 &)。

Return 3221225725:死循环 / 数组开过大。

Return 3221225620:除以 00。


No WA\Large\quad\\\quad\\\textbf{No WA}
  • unique() →\to 之前要 sort()

  • 多测清空 →\to 别用 memset() 用循环(指没有限制 TT 限制 ∑n\sum n 的题目)

  • n≠m≠k≠q≠…n \neq m \neq k \neq q \neq \dots

  • 不开 long long 见祖宗

    • #define int long long →MLE    or    TLE\to \text{MLE}\;\;{}_{or}\;\;\text{TLE}
    • int →WA\to \text{WA}
    • using ll = long long; →CE\to \text{CE}
    • typedef long long ll; →AC\to \text{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≤105→n\le 10^5\to 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}

  • (res += v) % P → WA\to\ \text{WA} (res += v) %= P → AC\to\ \text{AC}

  • std::cout << tmp << '\n'; → WA\to\ \text{WA} std::cerr << tmp << '\n'; → TLE\to\ \text{TLE} // std::cerr << tmp << '\n'; → AC\to\ \text{AC}

  • char s[N], t[N], n, m; → RE\to\ \text{RE} char s[N], t[N]; int n, m; → AC\to\ \text{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() 里的替换了。

共 2 篇
  1. 个人记录

    【AFO】OI 退役记「这是属于我们的容身之地,一场层层叠叠的戏剧」

    本文是作者Heldivis对三年OI生涯的回顾与总结,以诗意化的语言描绘了从初一至高一的竞赛历程。全文通过大量歌词引用和隐喻,展现了OI选手在算法竞赛中的挣扎与成长:初识OI时因兴趣参与,经历初赛高分、省选失利、集训磨砺等起伏;随着升学压力增大,最终选择在2024年NOIP后正式退役(AFO)。文中穿插了疫情期间的线上学习、集训中的技术突破(如根号分治、线段树合并等)、文化课与OI的冲突,以及对竞赛社区的眷恋。作者以"蝴蝶"自喻,表达了对OI生涯的复杂情感——既为技术提升而欣喜,又因现实压力而无奈,最终在释然中完成从"过客"到"职业选手"的身份转变。

  2. 题解

    题解:AT_abc359_f [ABC359F] Tree Degree Optimization

    ABC359F 大致思路:贪心。 由于这是一颗树,所以点的度数 d_i 需要满足 1≤ d_i ≤ n-1 且 ∑ d_i = 2(n-1)。 先把每个点都给一个度数,还有 n-2 个度数。 每次贪心,给一个增加一度后,增加最少的点。 对于一个度数已经为 d,点权为 a 的点,增…