GCD of Cartesian product of two arrays

Правка en2, от Saucemaster102, 2022-09-15 23:13:28

hey guys , a while back I had come across this problem(sorry I don’t have the link to problem statement) , it was basically, given two arrays a and b of size n and m , find the gcd of all the elements of the resultant array c where c is the Cartesian product of a and b , I could not figure out a better approach than O(n*m) Does anyone have a better approach ?

Constraints : n,m<1e+5

Теги gcd

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский Saucemaster102 2022-09-15 23:13:28 93
en1 Английский Saucemaster102 2022-09-15 23:09:19 351 Initial revision (published)