hiho week 211 register

Ended

Participants:209

Verdict:Accepted
Score:100 / 100
Submitted:2018-07-16 20:54:51

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#include<cstdio>
using namespace std;
long long f[100010][32],ans;
int n,x;
int main()
{
    scanf("%d",&n);
    for (int i=1;i<=n;i++)
    {
        scanf("%d",&x);
        for (int j=1;j<=31;j++)
         {
            ans+=f[j][1-(x%2)];
            f[j][x%2]++;
            x/=2;
         }
    }
    printf("%lld",ans);
}
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX