← all tags

Tag: inclusion-exclusion

1 post

GCDARR2. GCD Arrays (Hard)
CodeChef 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