Please read the new rule regarding the restriction on the use of AI tools. ×

frostcloud's blog

By frostcloud, history, 3 hours ago, In English

I tried to solve a today's 2014H - Robin Hood Archery, using the Mo's algorithm, but got a time limit on test 2.

My submission: 282366063. I expect it to work for O(n * sqrt(n) + k * log(k)), so I can't understand where I am mistaken

  • Vote: I like it
  • -1
  • Vote: I do not like it

»
101 minute(s) ago, # |
  Vote: I like it +5 Vote: I do not like it

I might be wrong but you are creating a basic_string for all testcases for length 1000011 are you sure the initialisation isnt O(size) ? because if it is then you are taking O(t * size) time and that will give you tle