Пожалуйста, подпишитесь на официальный канал Codeforces в Telegram по ссылке https://t.me/codeforces_official. ×

Блог пользователя vatsal

Автор vatsal, история, 8 лет назад, По-английски

How should I approach the problem 13049 ? I tried a simple approach (for lopps,etc) but it timed out as expected. Please provide a detailed(:P) explanation. P.S Anything about SQRT Decomposition?

  • Проголосовать: нравится
  • +13
  • Проголосовать: не нравится

»
8 лет назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

EDIT: It already ended, lol.

Well, I solved this problem using implicit treap. You can read this nice treap tutorial (Google translate).

My solution is a little slow, though. I want to know an alternative solution too :P