← All problemsSign in

SimpleOne

Instead of making a long story , Coming to the question directly . You are given an array A of size N , what you have to do , is to list out all the subarrays of the array , take the gcd's of each subarrays and push back the result into some container(1 indexed) . Now Q queries will be given to you , in each query you will be given a number X , you have to answer the Xth smallest number from the c

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