Блог пользователя nilsilu95

Автор nilsilu95, 10 лет назад, По-английски

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??

Теги gcd
  • Проголосовать: нравится
  • +3
  • Проголосовать: не нравится

»
10 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

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