Submission #8853527


Source Code Expand

#include <bits/stdc++.h>
using namespace std;
constexpr int P = 1'000'000'007;
int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n;
    cin >> n;
    vector<long long> a(n);
    for (int i = 0; i < n; ++i)
        cin >> a[i];
    int ans = 0;
    for (int k = 0; k < 60; ++k) {
        int c[2] = {};
        for (int i = 0; i < n; ++i)
            ++c[a[i] >> k & 1];
        ans = (ans + (1LL << k) % P * c[0] % P * c[1]) % P;
    }
    cout << ans << endl;
    return 0;
}

Submission Info

Submission Time
Task D - Xor Sum 4
User jiangly
Language C++14 (GCC 5.4.1)
Score 400
Code Size 522 Byte
Status AC
Exec Time 66 ms
Memory 2560 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 400 / 400
Status
AC × 3
AC × 21
Set Name Test Cases
Sample sample_01, sample_02, sample_03
All corner_01, corner_02, corner_03, random_11, random_12, random_13, random_14, random_15, random_21, random_22, random_23, random_24, random_25, random_31, random_32, random_33, random_34, random_35, sample_01, sample_02, sample_03
Case Name Status Exec Time Memory
corner_01 AC 20 ms 1152 KiB
corner_02 AC 44 ms 2176 KiB
corner_03 AC 24 ms 1024 KiB
random_11 AC 1 ms 256 KiB
random_12 AC 1 ms 256 KiB
random_13 AC 1 ms 256 KiB
random_14 AC 1 ms 256 KiB
random_15 AC 1 ms 256 KiB
random_21 AC 8 ms 512 KiB
random_22 AC 8 ms 512 KiB
random_23 AC 8 ms 512 KiB
random_24 AC 8 ms 512 KiB
random_25 AC 8 ms 512 KiB
random_31 AC 65 ms 2560 KiB
random_32 AC 66 ms 2560 KiB
random_33 AC 66 ms 2560 KiB
random_34 AC 66 ms 2560 KiB
random_35 AC 66 ms 2560 KiB
sample_01 AC 1 ms 256 KiB
sample_02 AC 1 ms 256 KiB
sample_03 AC 1 ms 256 KiB