ICPC 2019 Asia Danang Regional - Easy Query

Author: Benjamin Qi

This section is not complete.

Any help would be appreciated! Just submit a Pull Request on Github.

The first step is to determine sus_u and svs_v for each query with a Wavelet tree. Once we have these values, we can answer the queries in decreasing order of ll with a segment tree.

Solution

Join the USACO Forum!

Stuck on a problem, or don't understand a module? Join the USACO Forum and get help from other competitive programmers!