From d8b334be6e0368a6f1fd9376e79637ffc859ae45 Mon Sep 17 00:00:00 2001 From: Shuhao Zhang <594422141@qq.com> Date: Sun, 18 Aug 2019 19:56:14 +0800 Subject: [PATCH] =?utf8?q?=E7=A7=BB=E5=8A=A8=E5=8F=82=E8=80=83=E8=B5=84?= =?utf8?q?=E6=96=99=E5=88=B0=E6=96=87=E6=9C=AB?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- docs/misc/mo-algo.md | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/misc/mo-algo.md b/docs/misc/mo-algo.md index 5587b0aa..812790cb 100644 --- a/docs/misc/mo-algo.md +++ b/docs/misc/mo-algo.md @@ -2,8 +2,6 @@ author: greyqz ## 普通莫队算法 -(主要参考了 ) - ### 概述 莫队算法是由莫涛提出的算法,可以解决一类离线区间询问问题,适用性极为广泛。同时将其加以扩展,便能轻松处理树上路径询问以及支持修改操作。 @@ -216,7 +214,7 @@ struct node { ``` !!! warning - 小细节:如果使用 sort 比较两个函数,不能出现 $a < b$ 和 $b < a$ 同时为真的情况,否则会运行错误 + 小细节:如果使用 sort 比较两个函数,不能出现 $a < b$ 和 $b < a$ 同时为真的情况,否则会运行错误。 对于压行版,如果没有 `r == x.r` 的特判,当 l 属于同一奇数块且 r 相等时,会出现上面小细节中的问题(自己手动模拟一下),对于压行版,如果写成小于(大于)等于,则也会出现同样的问题。 @@ -792,3 +790,7 @@ if (!sta.empty()) { return 0; } ``` + +## 参考资料 + +- [莫队算法学习笔记 | Sengxian's Blog](https://blog.sengxian.com/algorithms/mo-s-algorithm) -- 2.11.0