We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
we can't solve this problem using simple dfs because
that will have a complexity of O(n^2) >=10^10.
So some lazy propagation is needed.
The editorial says it requires sqrt decomposition.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
DAG Queries
You are viewing a single comment's thread. Return to all comments →
we can't solve this problem using simple dfs because that will have a complexity of O(n^2) >=10^10. So some lazy propagation is needed. The editorial says it requires sqrt decomposition.