95152024-02-22 13:23:31TuruTamasXorzótáblacpp17Wrong answer 28/10037ms12296 KiB
#include <bits/stdc++.h>
using namespace std;

#ifdef DEBUG
ifstream in_file("C:\\verseny\\minta\\be1.txt");
#define input in_file
#define INTHENAMEOFGOD
#else
#define input cin
#define INTHENAMEOFGOD \
    ios::sync_with_stdio(0); \
    cin.tie(0); \
    cout.tie(0);
#endif
typedef long long ll;
typedef vector<ll> vi;
typedef vector<vi> vvi;
typedef vector<bool> vb;
typedef pair<ll, ll> pii;

ll N, M, a, b, ans;
array<ll, 64> an, am;

int main() {
    INTHENAMEOFGOD
    input >> N >> M;
    for (ll n = 0; n < N; n++) {
        input >> a;
        size_t ind = 0;
        while (a > 0) {
            an[ind] += a % 2;
            a >>= 1;
            ind++;
        }
    }
    for (ll m = 0; m < M; m++) {
        input >> b;
        size_t ind = 0;
        while (b > 0) {
            am[ind] += b % 2;
            b >>= 1;
            ind++;
        }
    }
    ll of = 0;
    bitset<64> ans(0);
    for (ll i = 0; i < 64; i++) {
        ans[i] = (an[i]*(M - am[i]) + (N - an[i])*am[i] + of) % 2;
        of = an[i]*am[i];
    }
    cout << ans.to_ullong() << endl;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1888 KiB
2Wrong answer32ms2508 KiB
subtask20/14
3Wrong answer3ms2696 KiB
4Wrong answer3ms2780 KiB
5Wrong answer3ms2908 KiB
6Wrong answer3ms2880 KiB
7Wrong answer3ms3100 KiB
8Wrong answer3ms3324 KiB
9Wrong answer3ms3432 KiB
subtask314/14
10Accepted3ms3640 KiB
11Accepted30ms4256 KiB
12Accepted34ms4808 KiB
13Accepted37ms5552 KiB
14Accepted37ms6068 KiB
subtask414/14
15Accepted23ms6228 KiB
16Accepted34ms6684 KiB
17Accepted32ms6948 KiB
18Accepted37ms7500 KiB
19Accepted37ms8264 KiB
subtask50/21
20Wrong answer6ms8488 KiB
21Wrong answer14ms8464 KiB
22Wrong answer17ms8500 KiB
23Wrong answer19ms8500 KiB
24Wrong answer20ms8828 KiB
25Accepted20ms8836 KiB
subtask60/37
26Wrong answer4ms8884 KiB
27Wrong answer24ms8888 KiB
28Wrong answer28ms9184 KiB
29Wrong answer28ms9460 KiB
30Wrong answer37ms10056 KiB
31Wrong answer37ms10600 KiB
32Accepted37ms11152 KiB
33Wrong answer37ms11736 KiB
34Wrong answer37ms12296 KiB