Submission #2414278


Source Code Expand

#include <bits/stdc++.h>
using namespace std;

int main()
{
    int n;
    cin >> n;
    int64_t a[n], b[n];
    for (auto &i : a)
    {
        cin >> i;
    }
    for (auto &i : b)
    {
        cin >> i;
    }
    int64_t ans = 0;
    for (int k = 0; k < 28; k++)
    {
        int64_t c[n], d[n], t = 1ll << k;
        for (int i = 0; i < n; i++)
        {
            c[i] = a[i] % (1ll << (k + 1));
            d[i] = b[i] % (1ll << (k + 1));
        }
        sort(d, d + n);
        int64_t num = 0;
        for (auto &i : c)
        {
            num += distance(d, lower_bound(d, d + n, 2 * t - i));
            num -= distance(d, lower_bound(d, d + n, t - i));
            num += distance(d, lower_bound(d, d + n, 4 * t - i));
            num -= distance(d, lower_bound(d, d + n, 3 * t - i));
        }
        if (num & 1)
        {
            ans += t;
        }
    }
    cout << ans << endl;
    return 0;
}

Submission Info

Submission Time
Task D - Two Sequences
User jbyxm
Language C++14 (GCC 5.4.1)
Score 0
Code Size 964 Byte
Status WA
Exec Time 2247 ms
Memory 6528 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 500
Status
AC × 4
AC × 12
WA × 4
Set Name Test Cases
Sample example_0, example_1, example_2, example_3
All N100000_0, N100000_1, N150000_0, N150000_1, N200000_0, N200000_1, N200000_ex_0, N200000_ex_1, example_0, example_1, example_2, example_3, rand_0, rand_1, smallrand_0, smallrand_1
Case Name Status Exec Time Memory
N100000_0 AC 1037 ms 3328 KB
N100000_1 WA 1039 ms 3328 KB
N150000_0 AC 1649 ms 4864 KB
N150000_1 WA 1645 ms 4992 KB
N200000_0 AC 2247 ms 6528 KB
N200000_1 WA 2244 ms 6528 KB
N200000_ex_0 AC 2122 ms 6528 KB
N200000_ex_1 AC 2123 ms 6528 KB
example_0 AC 1 ms 256 KB
example_1 AC 1 ms 256 KB
example_2 AC 1 ms 256 KB
example_3 AC 1 ms 256 KB
rand_0 AC 49 ms 384 KB
rand_1 WA 107 ms 640 KB
smallrand_0 AC 1 ms 256 KB
smallrand_1 AC 1 ms 256 KB