SHARE
TWEET

Untitled

a guest Apr 25th, 2019 63 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #include <iostream>
  2.  
  3. using namespace std;
  4.  
  5. int main() {
  6.     int n, cnt62, cnt2, cnt31, a, i;
  7.     cnt62 = 0;
  8.     cnt2 = 0;
  9.     cnt31 = 0;
  10.    
  11.     cin >> n;
  12.    
  13.     for (i = 0; i < n; i++) {
  14.         cin >> a;
  15.         if ( a % 31 == 0 && a % 2 != 0)
  16.             cnt31++;
  17.         if ( a % 2 == 0 && a % 31 != 0)
  18.             cnt2++;
  19.         if ( a % 62 == 0)
  20.             cnt62++;
  21.     }
  22.     cout << cnt2*cnt31 + cnt62*(n-1) - cnt62*(cnt62-1)/2;
  23.     return 0;
  24. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top