yoshi_likes_e5's blog

By yoshi_likes_e5, history, 5 months ago, In English

I just discovered a problem, https://qoj.ac/contest/1901/problem/8616, that the intended solution is https://mirror.codeforces.com/blog/entry/67001. Is there any sub $$$O(nq)$$$ solution for this problem?

  • Vote: I like it
  • +6
  • Vote: I do not like it

»
5 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Removed

»
5 months ago, hide # |
Rev. 2  
Vote: I like it 0 Vote: I do not like it

Are you interested in $$$\mathcal{O}(q\cdot\sqrt{n}\log^2(n)\log(max))$$$ solution?

EDIT:
I made a blog about this over an array(just use hld and you will have array one $$$\cdot\log{n}$$$ in the complexity).