Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <cmath>
- #include <iostream>
- #include <set>
- using namespace std;
- int cos(int x)
- {
- int s=0;
- for (int i=1;i<x;i++) s+=i;
- return s;
- }
- int main()
- {
- int n,i,x,a[4];
- for (i=0;i<=3;i++) a[i]=0;
- cin >> n;
- for (i=1;i<=n;i++)
- {
- cin >> x;
- if (x%26==0) a[3]++;
- else
- if (x%13==0) a[2]++;
- else if (x%2==0) a[1]++;
- }
- cout << a[3]*(n-a[3])+cos(a[3])+a[2]*a[1];
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement