Data Structures & AlgorithmsVery hardCodeforces Div2 B-D · ICPC regional

How many ordered pairs (x, y) with 1 <= x, y <= 10 satisfy gcd(x, y) = 1?

  1. A. 63
  2. B. 31
  3. C. 65
  4. D. 90

Correct answer: A. 63

Ordered pairs count (x, y) and (y, x) separately, so the value is about 6/pi^2 * 100 but exact by counting. Halving the count treats the ordered pairs as unordered, which is the usual slip.

More Arrays, Strings, Linked Lists, Stacks, Queues and Hashing questions

Exams that ask this topic