Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×

Find number of ancestors whose weight is greater than given query and node

Правка en1, от rpthegreat, 2017-08-18 11:48:47

Hello, Given a tree (nodes and their weight) and query which contains two number node (of tree guaranteed )and value c . I need to find number of ancestors which has weight greater than c. I saved query and sorted according to their query value. I stored graph node and their respective weight in 2-D array and sorted according to their weight. I set bit array initially all zero and start visiting query array from last. Now how to use segment tree for query. Do i need to use another concept ? please help me . Thank you.

Теги segment tree, sorting, offline query

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский rpthegreat 2017-08-18 11:48:47 617 Initial revision (published)