Problems > Count Squarefree in Range > Editorial

Count Squarefree in Range — Solution & Editorial

Back to the Problem

Prefix counts of the predicate; O(1) per query.

Complexity: O(N + Q)