Advertisement
ekaterinaparamonova

Untitled

Apr 10th, 2020
171
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.28 KB | None | 0 0
  1. k34 = k17 = k2 = k = res = 0;
  2. cin >> n;
  3. for (int i=0; i<n;i++)
  4.     cin >> x;
  5.     if (x % 34 == 0)
  6.         k34 += 1;
  7.     else if (x % 17 == 0)
  8.         k17 += 1;
  9.     else if (x % 2 == 0)
  10.         k2 += 1;
  11.     else
  12.         k += 1;
  13. cout << n * (n - 1) / 2 - k34 * (n - 1) - k17 * k2;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement