QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#21759#2829. CryptographyWhybullYMe#TL 2ms3652kbC++14534b2022-03-08 14:59:582022-05-08 04:02:04

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:04]
  • 评测
  • 测评结果:TL
  • 用时:2ms
  • 内存:3652kb
  • [2022-03-08 14:59:58]
  • 提交

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;
}

详细

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

result: