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

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

Hi,

Problem
My solution

I made a segment tree with a slight modification to the merge function from merge sort. The recurrence should come to:

Unable to parse markup [type=CF_TEX]

Which should be

Unable to parse markup [type=CF_TEX]

, for the initial building part. For each query it would take

Unable to parse markup [type=CF_TEX]

right? Why is this timing out? I made a huge test case and it kept running for like a minute. I tried fast i/o, tried to store results and output later, and converted the vector to list but nothing worked.

Is my analysis wrong? How do I make it faster? Please help.

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

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

I feel like your query_tree() works in O(n) 'cause of combine function called.