Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

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

im not able to understande why am i getting tle in spoj Qtree http://www.spoj.com/problems/QTREE/ problem. i have done a iterative hld(got the idea from https://apps.topcoder.com/forums/?module=Thread&threadID=796128&start=0&mc=8) and construct a segment tree with the num[] array. then made the query on that. outputs are correct.But it is getting tle. my solution is https://ideone.com/CdiscT

here head[] contains the chain head of a node. chain[] array represents the chain id . i have stored the edge value on the node whose depth is larger.

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

»
6 лет назад, # |
  Проголосовать: нравится -11 Проголосовать: не нравится

Wow! :D

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

Check the break condition in update function