← All problemsSign in

Almost Prime

Chef Polo is experimenting with Prime Numbers. He can quickly tell whether a number is prime or not. His friend Palin knows about it, so he twists the question. Palin challenges his friend to check whether a number P is "almost prime" or not. The number P is said to be almost prime if it has exactly 3 distinct divisors. A number d is said to be divisor of P if P is divisible by d. Chef Polo is

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