hiho week 211 register

Ended

Participants:209

Verdict:Accepted
Score:100 / 100
Submitted:2018-07-21 14:26: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 <stdio.h>
#include <vector>
#include <utility>
using namespace std;
int main()
{
    int N;
    scanf("%d", &N);
    vector<int> nums(N, 0);
    for (int i = 0; i < N; ++i)
    {
        scanf("%d", &nums[i]);
    }
    
    vector<pair<int, int>> bitNums(32, pair<int, int>(0, 0));
    for (int num : nums)
    {
        for (int i = 0; i < 32; ++i)
        {
            if (num & 1)
            {
                ++bitNums[i].first;
            }
            else
            {
                ++bitNums[i].second;
            }
            
            num >>= 1;
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX