Shubham Loves Maths
Our friend Shubham loved solving maths problems. Today he came accross this function which is used to calculate the strength of a number int strength(int N) { int value = 0, temp = N; /*Array lp stores the lowest prime divisor i.e. lp[x] stores lowest prime divisor of x*/ while(temp != 1) { value += N / lp[temp]; temp /= lp[temp]; } return value; } Having learnt sieving and related algorithms, w
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