Good count
CodeChefOpen on judge ↗
DY and DX received an array generator on the occasion of Codigo and being the math buffs that they are, a math game was quickly formulated. Consider an array $A$ which consists of $N$ elements $A_1, A_2, ..., A_N$. An index $i$ of the given array is considered good if $A_i = i$. DY wins the game if the count of good indices in the array is co-prime to the size of the array, while DX wins the ot
HINT LADDERno hints yet
L1 Observation
L2 Technique
L3 Approach
L4 Pseudo-code
🔒
L5 Full solution
L5 unlocks only if you insist twice
solution.cppC++17
CodeSearch Tutor
Hints, not spoilers — it won’t hand over the full solution unless you insist.
Sign in to chat with the tutor and save your progress.
Sign in to start