QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#21759 | #2829. Cryptography | WhybullYMe# | TL | 2ms | 3652kb | C++14 | 534b | 2022-03-08 14:59:58 | 2022-05-08 04:02:04 |
Judging History
answer
#include<iostream>
#include<cstdio>
using namespace std;
int n,m,f[1<<16],g[1<<16],h[1<<16];
int main()
{
while(cin>>n>>m)
{
for(int i=0;i<1<<n;++i)
cin>>f[i];
for(int i=0;i<1<<n;++i)
cin>>g[i];
for(int i=0;i<1<<n;++i)
cin>>h[i];
while(m--)
{
int a,b,c,x,y;
cin>>a>>b;
c=h[a]^b;
y=g[c]^a;
x=f[y]^c;
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: 3652kb
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: 1ms
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 ...