[problem:1731A]↵
↵
Idea: [user:s_jaskaran_s,2022-12-27]↵
↵
↵
<spoiler summary="Hint">↵
What is the maximum value of $a + b$ when $a \cdot b = x$?↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731A]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code">↵
[submission:186975476]↵
</spoiler>↵
↵
↵
[problem:1731B]↵
↵
Idea: [user:s_jaskaran_s,2022-12-27]↵
↵
↵
<spoiler summary="Hint">↵
Check which direction is optimal for the next 2 steps and why? ↵
↵
- 2 times Right? ↵
↵
- 2 times Down?↵
↵
- 1 time Right and 1 time Down? ↵
↵
- 1 time Down 1 time Right?↵
↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731B]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code">↵
[submission:18695754620]↵
</spoiler>↵
↵
↵
[problem:1731C]↵
↵
Idea: [user:ka_tri,2022-12-27]↵
↵
<spoiler summary="Hint 1">↵
What are the numbers with the odd number of divisors?↵
</spoiler>↵
↵
<spoiler summary="Hint 2">↵
How many numbers with the odd number of divisors can be there in the range $2 \cdot 10^5$?↵
</spoiler>↵
↵
<spoiler summary="Hint 3">↵
Try using prefix $\operatorname{XOR}$, iterating through all such numbers.↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731C]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code(C++)">↵
[submission:1869542275655]↵
</spoiler>↵
↵
<spoiler summary="Code(Python)">↵
[submission:18695495375680]↵
</spoiler>↵
↵
↵
[problem:1731D]↵
↵
Idea: [user:s_jaskaran_s,2022-12-27]↵
↵
↵
<spoiler summary="Hint 1">↵
For a particular size, how to check if there's a cube greater than that?↵
</spoiler>↵
↵
<spoiler summary="Hint 2">↵
Try Binary search on side length.↵
</spoiler>↵
↵
<spoiler summary="Hint 3">↵
Let $x$ be the side length. How to check if a square has all its elements $\geq x$ in $O(1)$?↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731D]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code(Prefix Sum)">↵
[submission:18695395075714]↵
</spoiler>↵
↵
<spoiler summary="Code(Sparse Table)">↵
[submission:1869538075738]↵
</spoiler>↵
↵
↵
[problem:1731E]↵
↵
Idea: [user:s_jaskaran_s,2022-12-27]↵
↵
↵
<spoiler summary="Hint 1">↵
Can you find the number of edges for each possible $GCD$?↵
</spoiler>↵
↵
<spoiler summary="Hint 2">↵
Did you try Greedy?↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731E]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code">↵
[submission:18695510375762]↵
</spoiler>↵
↵
↵
[problem:1731F]↵
↵
Idea: [user:nishkarsh,2022-12-27] and [user:s_jaskaran_s,2022-12-27]↵
↵
↵
↵
<spoiler summary="Solution">↵
[tutorial:1731F]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code">↵
[submission:18695292075785]↵
</spoiler>↵
↵
↵
Idea: [user:s_jaskaran_s,2022-12-27]↵
↵
↵
<spoiler summary="Hint">↵
What is the maximum value of $a + b$ when $a \cdot b = x$?↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731A]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code">↵
[submission:186975476]↵
</spoiler>↵
↵
↵
[problem:1731B]↵
↵
Idea: [user:s_jaskaran_s,2022-12-27]↵
↵
↵
<spoiler summary="Hint">↵
Check which direction is optimal for the next 2 steps and why? ↵
↵
- 2 times Right? ↵
↵
- 2 times Down?↵
↵
- 1 time Right and 1 time Down? ↵
↵
- 1 time Down 1 time Right?↵
↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731B]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code">↵
[submission:1869
</spoiler>↵
↵
↵
[problem:1731C]↵
↵
Idea: [user:ka_tri,2022-12-27]↵
↵
<spoiler summary="Hint 1">↵
What are the numbers with the odd number of divisors?↵
</spoiler>↵
↵
<spoiler summary="Hint 2">↵
How many numbers with the odd number of divisors can be there in the range $2 \cdot 10^5$?↵
</spoiler>↵
↵
<spoiler summary="Hint 3">↵
Try using prefix $\operatorname{XOR}$, iterating through all such numbers.↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731C]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code(C++)">↵
[submission:1869
</spoiler>↵
↵
<spoiler summary="Code(Python)">↵
[submission:1869
</spoiler>↵
↵
↵
[problem:1731D]↵
↵
Idea: [user:s_jaskaran_s,2022-12-27]↵
↵
↵
<spoiler summary="Hint 1">↵
For a particular size, how to check if there's a cube greater than that?↵
</spoiler>↵
↵
<spoiler summary="Hint 2">↵
Try Binary search on side length.↵
</spoiler>↵
↵
<spoiler summary="Hint 3">↵
Let $x$ be the side length. How to check if a square has all its elements $\geq x$ in $O(1)$?↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731D]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code(Prefix Sum)">↵
[submission:1869
</spoiler>↵
↵
<spoiler summary="Code(Sparse Table)">↵
[submission:1869
</spoiler>↵
↵
↵
[problem:1731E]↵
↵
Idea: [user:s_jaskaran_s,2022-12-27]↵
↵
↵
<spoiler summary="Hint 1">↵
Can you find the number of edges for each possible $GCD$?↵
</spoiler>↵
↵
<spoiler summary="Hint 2">↵
Did you try Greedy?↵
</spoiler>↵
↵
<spoiler summary="Solution">↵
[tutorial:1731E]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code">↵
[submission:1869
</spoiler>↵
↵
↵
[problem:1731F]↵
↵
Idea: [user:nishkarsh,2022-12-27] and [user:s_jaskaran_s,2022-12-27]↵
↵
↵
↵
<spoiler summary="Solution">↵
[tutorial:1731F]↵
</spoiler>↵
↵
↵
↵
<spoiler summary="Code">↵
[submission:1869
</spoiler>↵
↵