We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
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.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Starfleet
You are viewing a single comment's thread. Return to all 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.