MI6 AGENTS
CodeChefOpen on judge ↗
There are $N$ Secret Organizations with ids from $1$ to $N$. Each organization has $A[i]$ agents. Agents are given ids from $1$ to $A[i]$. The agent with the id of $A[i]$ for each Organization is the leader of that Organization. The $power$ of each Organization is determined by the number of agents whose id forms a $co-prime$ $pair$ with the id of the leader of that Organization. $MI6
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