9515 | 2024-02-22 13:23:31 | TuruTamas | Xorzótábla | cpp17 | Wrong answer 28/100 | 37ms | 12296 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;
}
Subtask | Sum | Test | Verdict | Time | Memory | ||
---|---|---|---|---|---|---|---|
subtask1 | 0/0 | ||||||
1 | Accepted | 3ms | 1888 KiB | ||||
2 | Wrong answer | 32ms | 2508 KiB | ||||
subtask2 | 0/14 | ||||||
3 | Wrong answer | 3ms | 2696 KiB | ||||
4 | Wrong answer | 3ms | 2780 KiB | ||||
5 | Wrong answer | 3ms | 2908 KiB | ||||
6 | Wrong answer | 3ms | 2880 KiB | ||||
7 | Wrong answer | 3ms | 3100 KiB | ||||
8 | Wrong answer | 3ms | 3324 KiB | ||||
9 | Wrong answer | 3ms | 3432 KiB | ||||
subtask3 | 14/14 | ||||||
10 | Accepted | 3ms | 3640 KiB | ||||
11 | Accepted | 30ms | 4256 KiB | ||||
12 | Accepted | 34ms | 4808 KiB | ||||
13 | Accepted | 37ms | 5552 KiB | ||||
14 | Accepted | 37ms | 6068 KiB | ||||
subtask4 | 14/14 | ||||||
15 | Accepted | 23ms | 6228 KiB | ||||
16 | Accepted | 34ms | 6684 KiB | ||||
17 | Accepted | 32ms | 6948 KiB | ||||
18 | Accepted | 37ms | 7500 KiB | ||||
19 | Accepted | 37ms | 8264 KiB | ||||
subtask5 | 0/21 | ||||||
20 | Wrong answer | 6ms | 8488 KiB | ||||
21 | Wrong answer | 14ms | 8464 KiB | ||||
22 | Wrong answer | 17ms | 8500 KiB | ||||
23 | Wrong answer | 19ms | 8500 KiB | ||||
24 | Wrong answer | 20ms | 8828 KiB | ||||
25 | Accepted | 20ms | 8836 KiB | ||||
subtask6 | 0/37 | ||||||
26 | Wrong answer | 4ms | 8884 KiB | ||||
27 | Wrong answer | 24ms | 8888 KiB | ||||
28 | Wrong answer | 28ms | 9184 KiB | ||||
29 | Wrong answer | 28ms | 9460 KiB | ||||
30 | Wrong answer | 37ms | 10056 KiB | ||||
31 | Wrong answer | 37ms | 10600 KiB | ||||
32 | Accepted | 37ms | 11152 KiB | ||||
33 | Wrong answer | 37ms | 11736 KiB | ||||
34 | Wrong answer | 37ms | 12296 KiB |