QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#55852#2829. Cryptographyindogent#TL 3ms3752kbC++20532b2022-10-15 14:12:202022-10-15 14:12:21

Judging History

你现在查看的是最新测评结果

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-10-15 14:12:21]
  • 评测
  • 测评结果:TL
  • 用时:3ms
  • 内存:3752kb
  • [2022-10-15 14:12:20]
  • 提交

answer

#include <iostream>
using namespace std;
int f[1000005], g[1000005], h[1000005];
int main() {
  ios::sync_with_stdio(false);
  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;
}

详细

Test #1:

score: 100
Accepted
time: 3ms
memory: 3752kb

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: 2ms
memory: 3596kb

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: