← All problemsSign in

Alice And Her True Friends

Alice has $N$ friends but she believes that not all her friends are true friends. She considers her $i^{th}$ friend as a true friend only if $i$ is composite. Some of Alice's friends know each other. If $A$ knows $B$, then $B$ knows $A$. Also If $A$ knows $B$ and $B$ knows $C$ then $A$ knows $C$. Alice wants to know what is the size of the largest group of her friends who know each other such t

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.

voice by Sarvam AI

Sign in to chat with the tutor and save your progress.

Sign in to start