QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#21769 | #2829. Cryptography | LFCode# | TL | 1ms | 1832kb | C++14 | 667b | 2022-03-08 15:03:58 | 2022-05-08 04:02:56 |
Judging History
answer
//什么时候我才能有杜爷一半强啊/kk
#include<cstdio>
const int N=200086;
int n,m,f[N],g[N],h[N];
int read(){
char ch=getchar();int nn=0,ssss=1;
while(ch<'0'||ch>'9'){if(ch=='-')ssss*=-1;ch=getchar();}
while(ch>='0'&&ch<='9'){nn=nn*10+(ch-'0');ch=getchar();}
return nn*ssss;
}
bool solve(){
for(int i=0;i<(1<<m);i++)f[i]=read();
for(int i=0;i<(1<<m);i++)g[i]=read();
for(int i=0;i<(1<<m);i++)h[i]=read();
for(int i=1;i<=n;i++){
int a=read();int b=read();
int y=g[b^h[a]]^a;
int x=b^f[y]^h[a];
printf("%d %d\n",x,y);
}
return true;
}
int main(){
//freopen("C.in","r",stdin);
while(~scanf("%d%d",&n,&m))solve();
}
Details
Tip: Click on the bar to expand more detailed information
Test #1:
score: 100
Accepted
time: 1ms
memory: 1832kb
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: 1808kb
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 0 1 0 1 0 1 1 1 0 1 1 0 0 1 1 1 0 1 1 0 1 0 1 1 1 1 0 1 0 1 1 1 0 1 1 1 0 0 0 1 1 0 0 0 0 1 1 2 0 0 0 0 0 3 1 1 1 0 3 3 1 1 0 3 0 0 0 3 1 1 0 1 0 0 0 3 1 3 1 0 1 1 1 0 1 1 3 1 1 1 0 1 1 0 0 1 1 0 0 0 0 1 2 0 0 3 1 1 0 0 0 0 1 1 3 0 3 0 1 1 0 1 0 1 1 1 1 0 1 1 1 1 1 1 0 0 1 1 0 0 1 3 1 0 0 0 1 0 1 ...