diff --git a/solutions/platinum/cses-1750.mdx b/solutions/platinum/cses-1750.mdx index b135fecc82..9ed57f0609 100644 --- a/solutions/platinum/cses-1750.mdx +++ b/solutions/platinum/cses-1750.mdx @@ -5,7 +5,7 @@ title: Planet Queries I author: Dong Liu --- -**Time Complexity**: $\mathcal{O}(N\log N)$ +## Explanation Construct a parent matrix (where $\texttt{parent}[i][d]$ is the $2^d$th parent of $i$). Then, we can answer each query by using @@ -15,8 +15,11 @@ representation of the distance. Since the query distances can be up to $10^9$, we set the maximum depth to $\lceil{\log_2{10^9}}\rceil = 30$. - +## Implementation + +**Time Complexity**: $\mathcal{O}(N\log N)$ + ```cpp @@ -56,5 +59,4 @@ int main() { ``` -