https://codeforces.com/contest/1006/problem/E
I know how to use euler tour here but not able to understand how to find particular element on that index
help me out
https://codeforces.com/contest/1006/problem/E
I know how to use euler tour here but not able to understand how to find particular element on that index
help me out
@yashme7125 we will travel the tree and store the order of nodes and also we will sort the list of the nodes first as demanded in the question the nodes visited should be in the assending order and we also store the size of subtree of every node then we have 2 cases for each query
a is the node
b is the kth node
two cases are
here is the code
Coding Blocks IDE
if you still have any dout let me know and if clear please rate my experience…
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
Sir, can you check my code and tell what’s wrong in this it’s almost same as you told
but giving me segmention fault.
@yashme7125 in start of your code resize the vector idx to n+1 or use map instead of a vector idx use map<int,int> idx