Abhishek and GCD
CodeChefOpen on judge ↗
Abhishek was recently trying to solve a problem related to GCD.He got stuck and needs help.The problem is as follows: A positive number Y is said to be special if gcd(Y,P)=1. Let F(P) be the count of all such special numbers which are less than or equal to P. Given an array A of N numbers, there are two types of queries. 1. 1 X Y: In this query,you need to update element in the array at index X
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