QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#56640 | #2829. Cryptography | foreverlasting | TL | 1ms | 7692kb | C++17 | 594b | 2022-10-20 21:50:20 | 2022-10-20 21:50:20 |
Judging History
answer
#include <iostream>
using namespace std;
int f[1000005], g[1000005], h[1000005];
int main() {
std::ios::sync_with_stdio(false);
std::cin.tie(nullptr);
std::cout.tie(nullptr);
int m, q;
while (cin >> m >> q) {
for (int i = 0; i < (1 << m); i++) cin >> f[i];
for (int i = 0; i < (1 << m); i++) cin >> g[i];
for (int i = 0; i < (1 << m); i++) cin >> h[i];
while (q--) {
int a, b;
cin >> a >> b;
int tmp = b ^ h[a];
int y = a ^ g[tmp];
int x = tmp ^ f[y];
cout << x << ' ' << y << endl;
}
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 7692kb
input:
2 2 0 1 2 3 1 2 3 0 2 3 0 1 0 1 2 3 1 1 0 0 0 0 0 0 0 0
output:
3 0 1 2 0 0
result:
ok 3 lines
Test #2:
score: 0
Accepted
time: 1ms
memory: 7676kb
input:
1 1 0 0 0 0 0 0 0 0
output:
0 0
result:
ok single line: '0 0'
Test #3:
score: -100
Time Limit Exceeded
input:
1 2 1 1 0 0 0 0 1 1 1 0 1 2 0 0 0 1 0 1 1 0 1 1 1 2 0 1 1 0 0 0 1 0 1 0 1 2 0 0 0 1 1 1 0 0 1 1 1 2 0 1 1 0 0 1 0 1 0 0 1 2 1 1 0 1 0 1 1 0 0 0 1 2 1 1 0 1 1 0 1 0 0 1 1 2 0 0 1 0 1 1 1 1 1 1 1 2 1 1 0 1 1 0 1 0 0 1 1 2 0 1 0 0 0 0 0 1 0 1 1 2 1 1 1 0 1 0 1 0 1 1 1 2 1 1 1 0 1 1 0 1 0 0 1 2 1 1 0 1 ...
output:
0 1 1 1 1 0 0 1 0 0 0 0 1 1 0 1 1 0 1 1 0 0 1 0 1 1 1 0 0 0 0 0 1 1 1 0 1 0 1 0 1 0 0 1 1 1 0 0 0 1 0 1 1 0 1 1 0 1 1 0 0 1 0 1 1 0 0 1 1 1 1 1 0 0 0 1 0 1 1 0 1 1 1 0 0 1 1 1 0 1 0 0 1 1 0 1 1 1 0 1 0 0 0 1 1 1 0 0 0 0 1 1 0 0 1 1 1 1 0 1 0 1 0 0 1 1 1 1 0 1 1 0 0 0 1 1 1 0 1 1 1 0 0 1 0 1 1 0 1 1 ...