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

Автор Ssaranshh13, история, 17 месяцев назад, По-английски

Link to the problem : CSES- Subset Queries In the problem, I flattened the tree and used Euler tours to access subtrees, and used a segment tree to answer the queries on the subtrees. The solution's overall time complexity should be O(nlogn). But it's giving TLE on a larger value of n.

My submission: Click here

Please tell me where I am doing this wrong. Thank you in advance.

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

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

void Build(vector<ll> a,ll node, ll L, ll R)

pass a by reference