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() {