# |
Author |
Problem |
Lang |
Verdict |
Time |
Memory |
Sent |
Judged |
|
223864848 |
Contestant:
zzn_nzz |
1870B
- 19
|
C++14 (GCC 6-32)
|
Accepted
|
763 ms
|
3140 KB
|
2023-09-18 17:52:06 |
2023-09-18 20:08:18 |
|
#include <iostream>
#include <iomanip>
#include <cstring>
#include <cmath>
#include <map>
#include <list>
#include <vector>
using namespace std;
long long T, n, m, a[200050], b[200050];
int main(){
cin >> T;
while(T --) {
cin >> n >> m;
long long ans0 = 0, ans1 = 0;
for(int i = 1; i <= n; ++ i) {
cin >> a[i];
ans0 ^= a[i];
ans1 ^= a[i];
}
long long bb = 0;
for(int i = 1; i <= m; ++ i) {
cin >> b[i];
bb |= b[i];
}
if(n & 1) {
cout << ans0 << " " << (ans1 | bb) << endl;
} else {
cout << (ans0 & (~bb)) << " " << ans1 << endl;
}
}
}
Click to see test details