Skip to content

Commit 29cb849

Browse files
Update cc-KSIZEGCD.mdx
the GCD can change up to 446 times not 30
1 parent 892e4a8 commit 29cb849

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

solutions/gold/cc-KSIZEGCD.mdx

+3-3
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,9 @@ Can we upper bound the number of times the GCD changes?
1313

1414
<Spoiler title="Answer to Hint 1">
1515

16-
Note that the GCD can only decrease, and it will always remove some factor from the current GCD.
17-
The smallest factor we can remove is $2$, and $a_i \leq 10^9$, so the GCD can only change at most
18-
$log_2(10^9) \approx 30$ times.
16+
Note that the GCD can only decrease and there are two ways for it to do so, we will either remove some factor from the current GCD or find another GCD at a different position.
17+
The smallest factor we can remove is $2$, and $a_i \leq 10^9$, so in this way the GCD can only change at most
18+
$log_2(10^9) \approx 30$ times. But let's consider an array of type $[A, 1, A-1, A-1, 1, A-2, A-2, A-2, 1...]$ if the array has size $1e5$ the number of times the gcd changes is actually $446$ but this is still good enough.
1919

2020
</Spoiler>
2121

0 commit comments

Comments
 (0)