Karthik and Numbers
CodeChefOpen on judge ↗
Karthik wants to impress his friend Eratosthenes by playing with numbers. The friend has an obsession with prime numbers. E believes a number is interesting if and only if it has a prime number of unique factors (excluding 1 and the number itself). Given Q queries, tell the number of different interesting numbers that Karthik can pick, in the range L to R (including both L and R). Can you help K
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