Acm 常用算法模板
1.16.14 直线关于圆的反射.......................................................................................................................................................90
1.16.15 pku2002_3432_N 个点最多组成多少个正方形(hao).................................................................................................95
1.16.16 pku1981_单位圆覆盖最多点(poj1981)CircleandPoints..............................................................................................98
1.16.17 pku3668_GameofLine_N 个点最多确定多少互不平行的直线(poj3668).................................................................100
1.16.18 求凸多边形直径.........................................................................................................................................................102
2.
组合
...................................................................................................................................................103
2.1 组合公式......................................................................................................................................................103
2.2 排列组合生成..............................................................................................................................................104
2.3 生成 gray 码.................................................................................................................................................106
2.4 置换(polya)..................................................................................................................................................106
2.5 字典序全排列..............................................................................................................................................107
2.6 字典序组合..................................................................................................................................................107
2.7 一些原理及其例子......................................................................................................................................108
3.
数论
...................................................................................................................................................110
3.1 阶乘最后非 0 位...........................................................................................................................................110
3.2 模线性方程组..............................................................................................................................................110
3.3 素数.............................................................................................................................................................112
3.4 欧拉函数......................................................................................................................................................116
3.6 高精度..........................................................................................................................................................118
3.6.1 平方根.............................................................................................................................................................................118
3.6.2 高精度乘幂.....................................................................................................................................................................119
3.7 高斯消元回代法..........................................................................................................................................125
3.8 数值计算......................................................................................................................................................126
3.8.1 定积分计算.....................................................................................................................................................................126
3.8.2 多项式求根(牛顿法).......................................................................................................................................................128
3.8.3 周期性方程(追赶法).......................................................................................................................................................129
4.
排序
...................................................................................................................................................130
4.1 快速选择算法..............................................................................................................................................130
4.2 归并排序+逆序数的求取.............................................................................................................................131
5.
字符串
...............................................................................................................................................132
5.1 KMP 应用.....................................................................................................................................................132
5.2 后缀数组......................................................................................................................................................133
5.3 中缀表达式转后缀表达式...........................................................................................................................137
5.4 Fireghters 表达式求值...............................................................................................................................138
3
- 1
- 2
前往页