hiho week 211 register

Ended

Participants:209

Verdict:Accepted
Score:100 / 100
Submitted:2018-07-21 13:47:09

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 <iostream>
#include <vector>
#include <algorithm>
#include <string>
#include <limits.h>
using namespace std;
int n;
int main() {
    cin >> n;
    vector <long long> a(n);
    long long ma = 0;
    for (int i = 0; i < n; i++) {
        cin >> a[i];
        ma = max(ma, a[i]);
    }
    int t = 0;
    while (ma > 0) {
        ma = ma / 2;
        t++;
    }
    vector <vector<int>> digits(n,vector<int>(t,0));
    for (int i = 0; i < n; i++) {
        long long x = a[i];
        int len = 0;
        while (x > 0) {
            digits[i][len] = x % 2;
            len++;
            x = x / 2;
        }
    }
    long long ans = 0;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX