File tree Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Expand file tree Collapse file tree 4 files changed +12
-4
lines changed Original file line number Diff line number Diff line change @@ -106,6 +106,7 @@ func fenwickTree(n int) {
106
106
107
107
// 求逆序对的方法之一
108
108
// 如果 a 范围较大则需要离散化(但这样还不如直接用归并排序)
109
+ // 归并做法见 misc.go 中的 mergeCount
109
110
// 扩展 https://codeforces.com/problemset/problem/362/C
110
111
// 环形最小逆序对 https://www.luogu.com.cn/problem/solution/P2995
111
112
// 扩展:某些位置上的数待定时的逆序对的期望值 https://codeforces.com/problemset/problem/1096/F
Original file line number Diff line number Diff line change @@ -832,6 +832,7 @@ func vec2Collection() {
832
832
// https://algs4.cs.princeton.edu/code/edu/princeton/cs/algs4/GrahamScan.java.html
833
833
// NOTE: 坐标值范围不超过 M 的凸多边形的顶点数为 O(√M) 个
834
834
// 模板题 https://www.luogu.com.cn/problem/P2742 LC587 https://leetcode-cn.com/problems/erect-the-fence/
835
+ // 构造 LCP15 https://leetcode-cn.com/problems/you-le-yuan-de-mi-gong/
835
836
// 限制区间长度的区间最大均值问题 https://codeforces.com/edu/course/2/lesson/6/4/practice/contest/285069/problem/A
836
837
// todo poj 2187 1113 1912 3608 2079 3246 3689
837
838
convexHull := func (ps []vec ) (q []vec ) {
Original file line number Diff line number Diff line change @@ -416,10 +416,11 @@ func mapPos(a, b []int) []int {
416
416
return ids
417
417
}
418
418
419
- // 逆序对
419
+ // 归并排序与逆序对
420
420
// LC 面试题 51 https://leetcode-cn.com/problems/shu-zu-zhong-de-ni-xu-dui-lcof/
421
- // EXTRA: LC 327 https://leetcode-cn.com/problems/count-of-range-sum/
422
- // LC 493 https://leetcode-cn.com/problems/reverse-pairs/
421
+ // EXTRA: LC315 https://leetcode-cn.com/problems/count-of-smaller-numbers-after-self/
422
+ // LC327 https://leetcode-cn.com/problems/count-of-range-sum/
423
+ // LC493 https://leetcode-cn.com/problems/reverse-pairs/
423
424
// 一张关于归并排序的好图 https://www.cnblogs.com/chengxiao/p/6194356.html
424
425
func mergeCount (a []int ) int64 {
425
426
n := len (a )
Original file line number Diff line number Diff line change @@ -369,7 +369,12 @@ func sortCollections() {
369
369
// https://codeforces.com/gym/101649 K
370
370
// https://www.luogu.com.cn/problem/P1570
371
371
// https://loj.ac/p/149
372
- // 连续子段的算数平均值 https://codeforces.com/edu/course/2/lesson/6/4/practice/contest/285069/problem/A https://codeforces.com/problemset/problem/1003/C https://www.luogu.com.cn/problem/P1404 https://www.acwing.com/problem/content/104/
372
+ // 有长度限制的连续子段的(最大/最小)算数平均值
373
+ // https://codeforces.com/edu/course/2/lesson/6/4/practice/contest/285069/problem/A
374
+ // https://codeforces.com/problemset/problem/1003/C
375
+ // https://www.luogu.com.cn/problem/P1404
376
+ // https://www.acwing.com/problem/content/104/
377
+ // LC644 https://leetcode-cn.com/problems/maximum-average-subarray-ii/
373
378
// O(n) 做法见 04 年集训队周源论文《浅谈数形结合思想在信息学竞赛中的应用》(或紫书 p.243 例题 8-9,UVa 1451 https://onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&category=447&page=show_problem&problem=4197)
374
379
// 与 0-1 背包结合,即最优比率背包 https://www.luogu.com.cn/problem/P4377 https://ac.nowcoder.com/acm/contest/2271/F
375
380
// 与生成树结合,即最优比率生成树 https://www.luogu.com.cn/problem/P4951 http://poj.org/problem?id=2728
You can’t perform that action at this time.
0 commit comments