Coprime pairs.

Правка en1, от abhikolar1512, 2017-12-24 09:45:06

Suppose we are given an Array A of size N (N<=100000) and each element of array A[i]<=100000. Now I want to find rightmost element A[j] in subarray A[1]....A[i-1] for each A[i] such that gcd(A[j],A[i]) is 1 i.e. both are relatively comprime. How can this be done efficiently?

Теги gcd, math problem, euclidean algorithm, coprime

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en2 Английский abhikolar1512 2017-12-24 09:46:04 14
en1 Английский abhikolar1512 2017-12-24 09:45:06 289 Initial revision (published)