• + 0 comments

    Glad I got to learn something new (Mo's algorithm) here https://cp-algorithms.com/data_structures/sqrt_decomposition.html#mos-algorithm to solve this problem in , but I was still met with TLE for one test case. Annoyingly I had to include ios_base::sync_with_stdio(false) in the template to pass. Overall, terrible problem statement.