QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#368177 | #2829. Cryptography | hshshs# | WA | 35ms | 3888kb | C++14 | 554b | 2024-03-26 21:31:52 | 2024-03-26 21:31:54 |
Judging History
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;
}
詳細信息
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'