From c7abbc1b23ce8ed1e965754a20d9d529cf7c62e0 Mon Sep 17 00:00:00 2001 From: freakin23 Date: Mon, 16 Dec 2024 20:39:09 +0530 Subject: [PATCH] minor add --- solutions/platinum/cses-1750.mdx | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) 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() { ``` -