QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#21798#2829. CryptographyDoorKickers#TL 3ms3600kbC++20669b2022-03-08 15:50:582022-05-08 04:05:17

Judging History

This is the latest submission verdict.

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-08 04:05:17]
  • Judged
  • Verdict: TL
  • Time: 3ms
  • Memory: 3600kb
  • [2022-03-08 15:50:58]
  • Submitted

answer

#include <bits/stdc++.h>
using namespace std;
#define int long long
signed main() {
    int m, q;
    while (cin >> m >> q) {
        vector<int> f((1 << m)), g((1 << m)), h((1 << m));
        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];
        }
        for (int i = 1, a, b; i <= q; i++) {
            cin >> a >> b;
            int y = a ^ g[b ^ h[a]];
            int x = b ^ f[y] ^ h[a];
            cout << x << ' ' << y << '\n';
        }
    }
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 1ms
memory: 3520kb

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: 3ms
memory: 3600kb

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
...

result: