目录
1 STL 标准模板库......................................................................................................................................1
1.1 STL pair ........................................................................................................................................1
1.2 STL Set..........................................................................................................................................2
1.3 STL Vector ...................................................................................................................................3
1.4 STL String ....................................................................................................................................5
1.5 STL stack ......................................................................................................................................6
1.6 STL Queue...................................................................................................................................7
1.7 STL Map.......................................................................................................................................8
1.8 lower_bound 和 Upper_bound ..........................................................................................11
2. 复杂的数论 .........................................................................................................................................12
2.1 大数阶乘分割法.....................................................................................................................12
2.2 大数阶乘长度 Stirling 公式 ................................................................................................13
2.3 欧拉函数 ..................................................................................................................................13
2.4 快速幂.......................................................................................................................................15
2.5 GCD 与 LCM 与 ExtGcd ........................................................................................................16
2.6 素数测试(判断素数).......................................................................................................17
2.7 求逆元.......................................................................................................................................29
.2.8 原根 ..........................................................................................................................................32
2.9 莫比乌斯函数求法 ................................................................................................................35
2.10 ACM 博弈 ...............................................................................................................................38
2.11 数论相关公式........................................................................................................................43
3. 有趣的字符串.....................................................................................................................................44
3.1 判断回文串的方法 ................................................................................................................44
3.2 KMP 匹配 ..................................................................................................................................46
3.3 扩展 KMP .................................................................................................................................50
3.4 strstr 函数..................................................................................................................................52
4. 图论 .......................................................................................................................................................52
4.1 最小生成树的解法 ................................................................................................................52
4.2 二维曼哈顿最小生成树.......................................................................................................56
5. 数据结构..............................................................................................................................................62
5.1 树状数组 区间求和..............................................................................................................62
5.2 线段树.......................................................................................................................................64
评论0