forked from OI-wiki/OI-wiki
-
Notifications
You must be signed in to change notification settings - Fork 0
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[pull] master from OI-wiki:master #17
Open
pull
wants to merge
931
commits into
jynychen:master
Choose a base branch
from
OI-wiki:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
* Update top-tree.md(typo) * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com>
* feat(op-overload.md): 增加了算数运算符重载的例子和三路比较 * style: format markdown files with remark-lint * fix(op-overload.md): 修改表述;更换三路比较信源至 cppreference * style: format markdown files with remark-lint * fix(op-overload.md): 修正引号使用 * fix(op-overload.md): 修正引用链接 --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com>
Update shortest-path.md
* fix(dsu-on-tree.md):修缮内容 * style: format markdown files with remark-lint * fix(dsu-on-tree.md):修缮内容 * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com>
fix(discrete.md):修改错字,将“跟据”修改为“根据”
…5732) * fix(math/number-theory/prime.md): 修复素性测试代码;修改奇怪用语 * fix(math/number-theory/prime.md): Carmichael 数的定义 定义前后不一
# 代码片段测试技术文档 拟通过一个新的PR引入用于在OI-Wiki代码仓库中的代码片段开展测试的功能。本文档对此功能的实现、使用细节进行介绍。 ## 1. 代码片段测试功能实现 目前的流程由 workflow 脚本检测发生改变的代码文件 `docs/some/path/code/topic/filename.cpp` 目录下的cpp文件。对于发生改动/新增的上述文件,scripts/test.py 脚本寻找 `docs/some/path/examples/topic/filename.in` 和 `docs/some/path/examples/topic/filename.out` 作为输入输出对,编译、运行此代码并检查输出是否符合预期。 此PR提出的新流程基于此基础之上,针对无法测试代码片段的问题进行改进,也一并完善其他功能要点。主要改动总结如下: - **代码片段测试功能** 使用代码自身及其(具有特定命名特征的)附属文件参与编译,在支持原有的单文件测试的同时使用多文件编译的方法支持对代码片段的测试。 现在脚本会在检测到代码文件改动时,寻找 `docs/some/path/code/topic/filename.cpp` 作为主文件,同时寻找命名形如 `docs/some/path/code/topic/filename.aux1.cpp` 作为辅助文件。并产生`gcc filename.cpp filename.aux1.cpp -o filename`的编译命令。 对于内容创作者,在主文件中可以只保留最核心的算法和数据结构定义,而将输入输出和辅助函数等部分放在辅助文件中,在OI-Wiki网站中只展示主文件以便精简代码篇幅,同时在测试时能运行完整的代码。 <details> <summary>大图预警</summary> <img src="https://github.com/user-attachments/assets/63de0ba4-61c1-4981-a2af-76286cf13957"/> </details> 这张图中的代码是将完整代码修改为代码片段后在前端的显示结果(相关改动在 f7446be 引入)。仅略去输入输出处理,大约节省了20行空间。 此外,OI-Wiki中也存在很多现有的无法运行无法测试的代码片段,被硬编码进md文档中。该功能的提出可允许将这些代码片段纳入到测试中。 - **多测试点支持** 修改触发测试的逻辑,扩大寻找测试点的范围,同时使测试点的改动也能引起测试。这允许增删改数据点,允许为一份代码添加多个测试点,也为接下来可能的用户提供样例功能提供便利。 现在脚本会在原先寻找 `docs/some/path/examples/topic/filename.in` 和 `docs/some/path/examples/topic/filename.ans` 的基础上,寻找形如 `docs/some/path/examples/topic/filename.1.in` 和 `docs/some/path/examples/topic/filename.1.ans` 作为额外的输入输出对。如果有读者发现了源代码的错误,可以直接通过PR提交新测试点即可。也有计划在未来使用(另一项目开发的)划词评论功能引导读者在网站上便捷地创建PR/Issue。 - **完善log和summary** 测试结果通过GitHub Action日志和Summary的形式展示。会比之前稍微详细一点吧...也许? ## 2. 效果展示 新的脚本文件根据测试执行情况可能得到以下结果: 1. AC ![ACLog](https://github.com/user-attachments/assets/b68b1dc6-5ee7-49f0-b204-5fc3b5ba8e72) ![ACSumm](https://github.com/user-attachments/assets/8af0b4a6-8dbc-45d3-b02a-62c74fb97262) 2. WA ![WALog](https://github.com/user-attachments/assets/09a3f372-ea58-4c65-9675-bc8721eb0d65) ![WASumm](https://github.com/user-attachments/assets/0ca061b6-2918-4ad2-be19-ceff11646dce) 3. RE ![RELog](https://github.com/user-attachments/assets/82b46185-ddbe-43d5-a04a-bc5f4f61d398) ![RESumm](https://github.com/user-attachments/assets/6ff4d7c6-91ef-4153-ace9-10948495e05f) 4. CE ![CELog](https://github.com/user-attachments/assets/b452ada0-23fa-4a46-961b-7944af3f6a6a) ![CESumm](https://github.com/user-attachments/assets/11ee7d44-1b20-4e8f-a0f8-524da36e9da8) 5. No Data (成功编译,但因为没有数据所以未能进一步测试) 从实际需要出发,这种情况视为通过,不会导致测试失败,但是会在GitHub Action Summary和Log中显示,并在File Changed视图中通过Annotation标记出来。审核者可以根据实际情况决定是否允许这种更改。 ![NDLog](https://github.com/user-attachments/assets/84dd867d-4f54-42c0-a9bb-db6a28f4117a) ![NDSumm](https://github.com/user-attachments/assets/23209e5b-1779-46b2-a83f-2ccc972ad62f) ![NDFc](https://github.com/user-attachments/assets/5fa0270d-9076-4fd3-8644-8fe752727f34) ## 3. 可用于参考的链接 (因为这个PR就绪之后会把为了测试特殊情况引入代码的改动全删掉所以到那时Action应该会是绿的,但是跑过的Action记录是能查到的,所以在这里把链接留下) 1. GitHub Action Log. https://github.com/OI-wiki/OI-wiki/actions/runs/10060883443/job/27809545688?pr=5729 2. GitHub Action Summary. https://github.com/OI-wiki/OI-wiki/actions/runs/10060883443?pr=5729
* feat(graph/scc): 完善了 Tarjan 算法的引入与前置的栈定义 * feat(graph/scc): 完善了 Tarjan 算法的引入与前置的栈定义,修改表达 Co-authored-by: Alphagocc <alphagocc@163.com> --------- Co-authored-by: Alphagocc <alphagocc@163.com>
Update cartesian-tree.md 键值用w表示,而不是k,应该是笔误
Update scc.md
* fix(ds/cartesian-tree): improve content * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com>
* fix(docs/contest/common-mistakes.md): 删去一个错项 删去了“特别的,也不能在执行 ios::sync_with_stdio(false); 后使用 freopen。”。这并没有理论依据,且很可能是无中生有的说法。 * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com>
* feat (graph/bcc.md): 修缮内容 * style: format markdown files with remark-lint * fix(docs\graph\examples\bcc\bcc_3.ans): 文件名错误 * fix(docs\graph\code\bcc\bcc_2.cpp): 代码错误 * fix(docs\graph\examples\bcc\bcc_3.ans): 数据错误 * fix(docs\graph\bcc.md):标题层级错误 * refactor(docs/bcc.md): 重构双连通分量的界面。 * feat(graph/bcc.md):将 DFS 算法更名为差分算法并优化描述,增加差分算法的示例代码 * feat(graph/bcc.md):增加一道边双差分算法的例题 * feat(graph/bcc.md):修正题解格式 * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com> Co-authored-by: xglight <liruikang2020@163.com>
* fix(graph/shortest-path.md):删除定义但未使用的函数参数 graph/shortest-path.md中dijkstra算法的优先队列C++实现定义了函数参数int n但并未在函数体内使用 * 优化dijkstra函数dis数组初始化 将dis数组的初始化范围改为使用的部分而不是全部 * style: format markdown files with remark-lint * 优化最短路算法初始化 * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com>
* feat: add top tree 1 * feat: add top tree 2 * feat: top tree 3 * feat: top tree 4 * feat: top tree 5 * feat: add top tree6
* feat: vectorize avl imgs * fix: adjust stroke and font size
* Update planar.md <feat>(planar.md): Add explanations about K_3,3 and K_5(添加了关于 K_3,3 和 K_5 的解释) * put in one line --------- Co-authored-by: Heran Yang <heran55@126.com>
Update aa-tree.md
feat(graph/dsu-on-tree): 启发式合并不是按秩合并
Update dominator-tree.md
Update matrix.md change "但是会在得到常数级别的提升" to "但是会得到常数级别的提升" in "矩阵乘法优化".(delete "在")
* feat (graph/bcc.md): 修缮内容 * style: format markdown files with remark-lint * fix(docs\graph\examples\bcc\bcc_3.ans): 文件名错误 * fix(docs\graph\code\bcc\bcc_2.cpp): 代码错误 * fix(docs\graph\examples\bcc\bcc_3.ans): 数据错误 * fix(docs\graph\bcc.md):标题层级错误 * refactor(docs/bcc.md): 重构双连通分量的界面。 * feat(graph/bcc.md):将 DFS 算法更名为差分算法并优化描述,增加差分算法的示例代码 * feat(graph/bcc.md):增加一道边双差分算法的例题 * feat(graph/bcc.md):修正题解格式 * style: format markdown files with remark-lint * feat(string/hash.md):增加 Hash 的错误率分析及卡法 * style: format markdown files with remark-lint * fix(docs/hash.md):修正 Markdown 格式 * style: format markdown files with remark-lint * fix(string/hash.md):将推导放入折叠框内 * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com> Co-authored-by: xglight <liruikang2020@163.com>
* fix(ds/wblt.md): 修正 typo 与代码错误 * fix(ds/wblt.md): 修正 merge 示例函数内引用不明确的情况 按照自己的理解联系下文将 upd 改为了 pushup --------- Co-authored-by: 起汐 <111039298+Yuuuics@users.noreply.github.com>
* feat: offset-inject frontend * refactor: fmt * refactor: do not throw an err when secret is not set * refactor: rename ADMINISTRATOR_SECRET * refactor: script version tag * refactor: fetch resource from node_modules * feat: dark mode support * fix: OffsetsInjectionReview is not defined * refactor: disable by default * refactor: renaming * refactor: append version to content script
* fix(contest/common-mistakes.md): 对于 Linux 下的栈空间限制的说明 * Update common-mistakes.md * Update common-mistakes.md * Update common-mistakes.md --------- Co-authored-by: Tifa <62847935+Tiphereth-A@users.noreply.github.com>
* feat(misc/15-puzzle.md): add a new picture * feat(misc/15-puzzle.md): add a new picture * add(misc/images/15puzzle-1.svg): 添加 svg 图像 * delete(docs/misc/images/15puzzle-1.png): 删去旧图 * modify(misc/15-puzzle.md): 改用 svg 图像 --------- Co-authored-by: 旅禾Tristan <i@qqzhi.cc>
* fix(graph/shortest-path): 修正 Dijkstra 复杂度分析 * style: format markdown files with remark-lint * Update shortest-path.md * Update shortest-path.md * style: format markdown files with remark-lint * fix(shortest-path.md): remove unused fn --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com> Co-authored-by: Tifa <62847935+Tiphereth-A@users.noreply.github.com>
Update(primitive-root.md): 使证明自然一点 原本的证明实质上是找到了 $\varphi(m)$ 的约数 $(t,\varphi(m))$。还用到了裴蜀定理…… 其实 $g$ 的阶就是满足条件的。
* refactor(math/stern-brocot): organize and rewrite * fix(docs/math/number-theory/stern-brocot.md): typo * apply suggestions --------- Co-authored-by: Tifa <62847935+Tiphereth-A@users.noreply.github.com>
* feat(basic/selection-sort.md): 增补对于稳定的选择排序的说明 直接给出“选择排序是不稳定的”之结论并不妥当,用链表可以容易地实现稳定的选择排序 * fix(basic/selection-sort.md): format
* feat(io_1.cpp): add example code * feat(io.md): add new examples * feat(io_1.in/io_1.ans): add example problem data * style: format markdown files with remark-lint * fix(io_1.in/io_1.ans): move to the correct folder * fix(io_1.in/io_1.ans): reduce input size * fix(io.md): correct imprecise expression * fix(io.md): improve expression * fix(io.md): removed the explaination of code * Revert "fix(io.md): removed the explaination of code" This reverts commit 78f4503. * fix(io.md): removed the explaination of code * feat(contest/io.md): polish the content * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com> Co-authored-by: Tifa <62847935+Tiphereth-A@users.noreply.github.com> Co-authored-by: Heran Yang <heran55@126.com>
* NumPy部分有误,已修改 * refactor(lang/python.md): styling --------- Co-authored-by: ksyx <18738953+ksyx@users.noreply.github.com>
* feat(docs/math/poly/newton.md): 增加多项式牛顿迭代的实例 * style: format markdown files with remark-lint * feat(docs/math/poly/newton.md): address comments
* Update python.md 更改混乱的排版 * fix(docs/lang/python.md):修改标题格式错误 * fix(docs/lang/python.md):再次修改标题格式错误 ()后添加空格 * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com>
* chore(workflow/typst): follow-ups for typst update commit * debug * fix wrong dir * delete debug info
fix(rbtree.md): 修正关于 shared_ptr 的笔误
fix(misc/expression.md): typo in LaTeX
* feat(ds/b-tree.md): 修改引入和对 B 树插入过程的描述以增加其可读性 * fix format * fix * change notation * 进一步修改措辞
<fix>(Update sieve.md):加强了原条件 对现实很多题目 $O(k)$ 才能求出 $f(p^k)$ 注意到 $p$ 个数为 $O(\frac{n}{\ln n})$ $p^k,k\geq 2$ 个数为 $O(\sqrt{n})$ 所以只需要在关于 $k$ 的低次多项式复杂度求出 $f(p^k)$ 总复杂度仍然为线性
* refactor(quadratic.md): organize and rewrite * fix: apply suggestions
* feat(primitive-root.md): 扩充定理、修改目录 1、将原本的原根个数定理用 d 阶元素数量包含 2、修改目录:删除阶的三级标题”性质“,修改原根部分标题 3、前几天的 PR 有一个 < 写成 \lt 了,已修改 * fix(primitive-root.md): 引用 * revert(primitive-root.md): 原根目录改回去了 * fix(primitive-root.md): 删标题 直接把标题删了。把那句话放到定义下面。把证明删了。
* fix(lang/const.md): tweak pygment lexer name * Update optimizations.md * Update treap.md
* refactor(lang/python.md): 删除口语化表达、统一python文档链接语言、添加表格 * style: format markdown files with remark-lint * Fix(lang/python):忘了加作者名单 * 修复空行 * 修复更多空行 * style: format markdown files with remark-lint * 添加表格说明、修复部分格式问题 * style: format markdown files with remark-lint * fix(python.md): indent * fix(python.md): indent * style: format markdown files with remark-lint * Apply suggestions from code review * fix(python.md): format * style: format markdown files with remark-lint --------- Co-authored-by: 24OI-bot <15963390+24OI-bot@users.noreply.github.com> Co-authored-by: Tifa <62847935+Tiphereth-A@users.noreply.github.com>
fix(docs/misc/two-pointer.md): 数据范围看着奇奇怪怪的
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
See Commits and Changes for more details.
Created by pull[bot]
Can you help keep this open source service alive? 💖 Please sponsor : )