From eca8062efb6b05364e7270d8e245961be53e5240 Mon Sep 17 00:00:00 2001 From: manoflearning <77jwk0724@gmail.com> Date: Wed, 19 Nov 2025 20:51:38 +0900 Subject: [PATCH] chore: update mo's --- src/7-misc/sqrt_decomposition_mos_algorithm.cpp | 16 +++++----------- 1 file changed, 5 insertions(+), 11 deletions(-) diff --git a/src/7-misc/sqrt_decomposition_mos_algorithm.cpp b/src/7-misc/sqrt_decomposition_mos_algorithm.cpp index b15c0a9..0d25c48 100644 --- a/src/7-misc/sqrt_decomposition_mos_algorithm.cpp +++ b/src/7-misc/sqrt_decomposition_mos_algorithm.cpp @@ -1,7 +1,4 @@ #include "../common/common.hpp" - -#include -using namespace std; int sq; struct se { int s, e, idx; @@ -9,15 +6,12 @@ struct se { if (s / sq != rhs.s / sq) return s / sq < rhs.s / sq; return e < rhs.e; } + // Zigzag Mo's (faster than basic Mo's Algorithm) + // bool operator<(const se &rhs) const { + // if(s / sq != rhs.s / sq) return s / sq < rhs.s / sq; + // else return (s / sq) & 1 ? e < rhs.e : e > rhs.e; + // } }; -// Zigzag Mo's (faster than basic Mo's Algorithm) -/*struct se { - int s, e, idx; - bool operator<(const se &rhs) const { - if(s / sq != rhs.s / sq) return s / sq < rhs.s / sq; - else return (s / sq) & 1 ? e < rhs.e : e > rhs.e; - } -};*/ vector q; vector ans; void input() {