← All problemsSign in

Partner GCD

Mr. M wants a partner for the FooBar's contest. He goes to Mr. H to ask him to be his partner. Mr. H being a clever person says, “if you can answer my problem correctly, I will surely be your partner.” The problem states - “Given an array of N numbers A1, A2, ... Ai, Ai+1, ... AN-1, AN, first find number of numbers such that gcd(Ai, i) = perfect square. Don’t consider 1 to be a perfect square. Le

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