摘要: 基本 gitignore A gitignore file specifies intentionally untracked files that Git should ignore. Files already tracked by Git are not affected; see the N 阅读全文
posted @ 2022-06-23 18:50 ijpq 阅读(47) 评论(0) 推荐(0)
摘要: 考虑这个例子: O = object class F(O): pass class E(O): pass class D(O): pass class C(D,F): pass class B(D,E): pass class A(B,C): pass L[A] = A + merge(L[B], 阅读全文
posted @ 2025-10-13 12:12 ijpq 阅读(7) 评论(0) 推荐(0)
摘要: Let's address your three questions one by one with a hardware-oriented, low-level perspective: 1️⃣ Pointer dereference overhead vs direct member acces 阅读全文
posted @ 2025-08-03 12:11 ijpq 阅读(26) 评论(0) 推荐(0)
摘要: https://jalammar.github.io/illustrated-transformer/ 阅读全文
posted @ 2025-07-27 21:40 ijpq 阅读(8) 评论(0) 推荐(0)
摘要: libcxx/include/__memory/pointer_traits.h中有两个常用的指针类型转换的模板 rebind_pointer 接受两个模板参数 From和To,将From类型的指针转换为To类型的指针 __rebind_pointer<From,To>::type pointer_ 阅读全文
posted @ 2025-06-07 15:06 ijpq 阅读(11) 评论(0) 推荐(0)
摘要: 来看allocator定义,首先是两个void特化版本 // include/__memory/allocator.h template <class _Tp> class allocator; #if _LIBCPP_STD_VER <= 17 || defined(_LIBCPP_ENABLE_ 阅读全文
posted @ 2025-06-07 14:37 ijpq 阅读(18) 评论(0) 推荐(0)
摘要: 模板偏特化对参数列表的要求 cpp官方文档会搞混parameter list和argument list的区别,因此不要只看文字描述 模板偏特化的声明方式 1.argument list不能和主模板的argument list相同 对于下面这份声明,argument list即syntax中的部分 阅读全文
posted @ 2025-05-31 15:01 ijpq 阅读(11) 评论(0) 推荐(0)
摘要: 通过阅读libcxx源码,学习stl实现方式,以及高级cpp技巧. 这是第一篇 目录红黑树背景知识1. 二叉搜索树(BST)2. AVL 树3. 红黑树4. 三者对比小结5. 在脑海中的映射6. zig-zig / zig-zaglibcxx源码cpp学习rbtree具体操作的代码 红黑树背景知识 阅读全文
posted @ 2025-05-30 01:22 ijpq 阅读(34) 评论(0) 推荐(0)
摘要: 概念 1D前缀和 目前见到的题目大多使用inclusive前缀和 [a1,a2 ,a3 ,....,an] [a1,a1+a2,a1+a2+a3,....,a1+a2+...+an] 前缀和数组 差分数组 通过性质,可以使用的技巧 对差分数组计算前缀和还原出原数组an 对原数组an,[l,r]中每个 阅读全文
posted @ 2025-05-25 11:23 ijpq 阅读(13) 评论(0) 推荐(0)
摘要: 完全可以的,只要方法对、持之以恒,练习后你一定能大幅追赶甚至超越那些从本科就一直打竞赛的同学。关键在于: 合理的学习曲线 刚开始时,你可能刷了几十道题才刚掌握一种套路;但是随着模式越来越多、方法越来越熟,后期你的学习效率会大幅提升。 大多数竞赛选手也是从零基础或弱基础起步,一步步积累,真正「炉火纯青 阅读全文
posted @ 2025-05-21 16:49 ijpq 阅读(75) 评论(0) 推荐(0)
摘要: 交换论证的一般步骤 定义“第 i 步”的贪心选择 明确你的贪心算法在第 i 步会选什么样的元素/操作,记作 \(g_i\)。 假设存在一个最优解 OPT 用 \((o_1, o_2, \dots, o_m)\) 表示它在各步的选择。 对第 i 步做区分 若 \(o_i = g_i\) 这一步两者一致 阅读全文
posted @ 2025-05-16 14:34 ijpq 阅读(92) 评论(0) 推荐(0)