← All problemsSign in

Time to Party

Lord Voldemort has just took control over Hogwarts and wants to throw a party. $N$ people are going to attend the party and they have to invite themselves .Each person has a unique number (which we call his id) between 1 to $N$. They have a strange way of inviting people .The process is "Every person invites those people whose id is a multiple of his own id by sending them a balloon and he can't i

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