105522024-04-05 12:36:12CWMXorzótáblacpp17Wrong answer 14/100996ms7516 KiB
#include <iostream>
#include <vector>
#include <set>
#include <queue>
#include <algorithm>
#include <climits>

using namespace std;
long long cMod = 2;

signed main()
{
    ios_base::sync_with_stdio(0);
    cin.tie(0);
    cout.tie(0);
    int sA, sB;
    cin >> sA >> sB;
    vector<int> a(sA);
    vector<int> b(sB);
    for (size_t i = 0; i < sA; i++)
    {
        cin >> a[i];
    }
    for (size_t i = 0; i < sB; i++)
    {
        cin >> b[i];
    }
    long long res = 0;
    while (cMod<4e9)
    {
        vector<int> aTemp(sA);
        vector<int> bTemp(sB);
        for (size_t i = 0; i < sA; i++)
        {
            aTemp[i] = a[i] % cMod;
        }
        for (size_t i = 0; i < sB; i++)
        {
            bTemp[i] = b[i] % cMod;
        }
        sort(aTemp.begin(), aTemp.end());
        sort(bTemp.begin(), bTemp.end());
        long long lLim = cMod / 2;
        long long uLim = cMod;
        int ans = 0;
        for (size_t i = 0; i < aTemp.size(); i++)
        {
            int lIdx = lower_bound(bTemp.begin(), bTemp.end(), lLim - aTemp[i]) - bTemp.begin();
            int uIdx = lower_bound(bTemp.begin(), bTemp.end(), uLim - aTemp[i]) - bTemp.begin();
            int ulIdx = lower_bound(bTemp.begin(), bTemp.end(), uLim+lLim - aTemp[i]) - bTemp.begin();
            int cDif = uIdx - lIdx + bTemp.size()-ulIdx;
            ans += cDif;
        }
        if (ans % 2 == 1) {
            res += cMod;
        }
        cMod *= 2;
    }
    cout << res/2;
    return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1832 KiB
2Wrong answer832ms4796 KiB
subtask214/14
3Accepted3ms2380 KiB
4Accepted4ms2464 KiB
5Accepted4ms2544 KiB
6Accepted4ms2672 KiB
7Accepted8ms2760 KiB
8Accepted8ms2888 KiB
9Accepted10ms2872 KiB
subtask30/14
10Accepted3ms2912 KiB
11Accepted902ms6244 KiB
12Wrong answer896ms6212 KiB
13Wrong answer995ms6640 KiB
14Wrong answer995ms6676 KiB
subtask40/14
15Accepted469ms5932 KiB
16Wrong answer632ms6544 KiB
17Wrong answer648ms6700 KiB
18Accepted721ms6972 KiB
19Accepted720ms7176 KiB
subtask50/21
20Accepted100ms4792 KiB
21Accepted352ms5912 KiB
22Wrong answer535ms6352 KiB
23Wrong answer606ms6904 KiB
24Accepted648ms6980 KiB
25Accepted444ms7068 KiB
subtask60/37
26Accepted71ms4572 KiB
27Accepted451ms6276 KiB
28Wrong answer787ms6804 KiB
29Wrong answer699ms6936 KiB
30Accepted996ms7516 KiB
31Accepted995ms7512 KiB
32Accepted453ms7512 KiB
33Accepted986ms7516 KiB
34Wrong answer986ms7412 KiB