QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#63828#2829. Cryptographypty6666TL 2ms3364kbC++14723b2022-11-23 14:23:462022-11-23 14:23:47

Judging History

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

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

answer

#include <cstdio>
#include <cstring>
#include <queue>
#include <algorithm>
#include <iostream>
#include <cmath>
#include <random>
using namespace std;
typedef long long ll;
const int maxn = 2e6 + 10;
int m,q;
int f[maxn],g[maxn],h[maxn];

int main() {
//	ios::sync_with_stdio( 0 );
//	cin.tie( 0 );
//	cout.tie( 0 );
	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];
		}
		for(int i = 1;i<=q;i++){
			int a,b;
			cin >> a >> b;
			int temp1 = b ^ h[a];
			int y = a ^ g[temp1];
			int x = temp1 ^ f[y];
			cout << x << " " << y << "\n";
		}
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 2ms
memory: 3284kb

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: 3364kb

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: