A Simple Function
CodeChefOpen on judge ↗
Let f(x) and g(x) be two functions defined as f(x) = x if x ≤ 1 = 0 if x%y = 0 where y= $a^2$, a ∈ N, a ≥ 2 = g(x) Otherwise. g(x) = -1 if x is a product of odd no. of distinct primes. = 1 if x is a product of even no. of distinct primes. You are given an integer $X$. Find f($X$). ###Input - First line contains a single integer
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