QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#21769#2829. CryptographyLFCode#TL 1ms1832kbC++14667b2022-03-08 15:03:582022-05-08 04:02:56

Judging History

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

  • [2023-08-10 23:21:45]
  • System Update: QOJ starts to keep a history of the judgings of all the submissions.
  • [2022-05-08 04:02:56]
  • 评测
  • 测评结果:TL
  • 用时:1ms
  • 内存:1832kb
  • [2022-03-08 15:03:58]
  • 提交

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

result: