← All problemsSign in

Biswa and GCD

Biswa has an array A[ ] consisting of N integers. He loves prime numbers, so he wants to calculate the value of the following function for his array: F(A) = number of non-empty sub-sequences of A[ ] such that gcd of all numbers in that sub-sequence is a power of a prime number, i.e p^e for some prime p and e>=1. Note: sub-sequences consisting of equal numbers occurring at different positions ar

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