Nadim's blog

By Nadim, 2 years ago, In English

Given an array of N positive integers a = {a1, a2, a3,......, an},
Find a pair of integers (ai, aj) such that gcd(ai, aj) = 1

Constraints:

  • 2 <= N <= 105
  • 1 <= ai <= 106

Full text and comments »

  • Vote: I like it
  • +24
  • Vote: I do not like it