hihoCoder太阁最新面经算法竞赛13 register

Ended

Participants:132

Verdict:Accepted
Score:100 / 100
Submitted:2016-11-01 16:43:07

Lang:G++

Edit
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#include<stdio.h>
#include<string.h>
#include<queue>
#include<vector>
#include<algorithm>
using namespace std;
const int N= 10000  +10;
typedef long long lld;
#define lson(x) (x<<1)
#define rson(x) (x<<1|1)
int a[2][31]={0};
void solve()
{
    lld sum=0;
    int n, i;
    scanf("%d", &n);
    while(n--)
    {
        lld t;
        scanf("%lld", &t);
        i=1<<30;
        int j=30;
        while(i)
        {
            bool x=i&t;
            sum+=a[x^1][j];
            a[x][j]++;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX