I would like to know how to solve CodeChef — Chef and Graph Queries online. I've solved this problem using an offline method.
My solution using MO's Algorithm: https://www.codechef.com/viewsolution/18109768
I would like to know how to solve CodeChef — Chef and Graph Queries online. I've solved this problem using an offline method.
My solution using MO's Algorithm: https://www.codechef.com/viewsolution/18109768
It appears that qiancl has written an online solution to this problem.