QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#368177#2829. Cryptographyhshshs#WA 35ms3888kbC++14554b2024-03-26 21:31:522024-03-26 21:31:54

Judging History

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

  • [2024-03-26 21:31:54]
  • 评测
  • 测评结果:WA
  • 用时:35ms
  • 内存:3888kb
  • [2024-03-26 21:31:52]
  • 提交

answer

#include<bits/stdc++.h>
#define maxn 100010
using namespace std;
int n,q,a1,a2,x,y;
int f[maxn],g[maxn],h[maxn],d[maxn];
int main() {
//	freopen("1.in", "r", stdin); 
    while(~scanf("%d%d",&n,&q)){
	    n=(1<<n);
	    for(int i=0;i<n;i++) d[i] = -1;
		for(int i=0;i<n;i++)scanf("%d",&f[i]);
		for(int i=0;i<n;i++){scanf("%d",&g[i]);if(d[g[i]]==-1)d[g[i]]=i;}
		for(int i=0;i<n;i++)scanf("%d",&h[i]);
		while(q--){
			scanf("%d%d",&a1,&a2);
			y=g[a2^h[a1]]^a1;
			x=d[a1^y]^f[y];
			printf("%d %d\n",x,y);
		}   	
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Test #1:

score: 100
Accepted
time: 0ms
memory: 3888kb

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: 0ms
memory: 3888kb

input:

1 1
0 0
0 0
0 0
0 0

output:

0 0

result:

ok single line: '0 0'

Test #3:

score: -100
Wrong Answer
time: 35ms
memory: 3772kb

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:

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

result:

wrong answer 1st lines differ - expected: '0 1', found: '1 1'