Notebook
All posts
Tags
Archive
About
☀
☾
All
›
CodeChef
›
Problems
Problems
1 post
GCDARR2. GCD Arrays (Hard)
Problems
·
Jun 19, 2026
·
12 min read
CodeChef / Problems
fix g as the interior GCD, count interior sequences with Möbius inversion, count valid endpoint pairs with inclusion-exclusion — O(M log M + M log N) per test case