nilsilu95's blog

By nilsilu95, 10 years ago, In English

Given a sequence a1, a2, ..., aN. Count the number of triples (i, j, k) such that 1 ≤ i < j < k ≤ N and GCD(ai, aj, ak) = 1. Here GCD stands for the Greatest Common Divisor.

http://www.codechef.com/LTIME13/problems/COPRIME3

the editorial is very difficult to understand,,isn't there any other methods??

Tags gcd
  • Vote: I like it
  • +3
  • Vote: I do not like it

| Write comment?
»
10 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Explicit introduction of mobius function in the editorial is unnecessary. Do you know the inclusion-exclusion principle?