QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#601266 | #8726. Magic Show | xwh_Marvelous | 0 | 0ms | 1956kb | C++14 | 1.6kb | 2024-09-29 21:58:18 | 2024-09-29 21:58:19 |
Alice
#include<bits/stdc++.h>
#include"Alice.h"
using namespace std;
//#define int long long
//#define mod 1000000007
#define N 5005
//#define pii pair<int,int>
//#define fi first
//#define se second
//#define rep(i,j,k) for(int i=j;i<=k;i++)
vector<std::pair<int, int>>op;
int a[N],b[N];
vector<int>ls[2];
int n=5000;
mt19937 rd(156168);
int p[N];
void gen(){
for(int i=3;i<=5000;i++)a[i]=rd()%63;
b[1]=0,b[2]=1;
for(int i=3;i<=5000;i++)b[i]=rd()%2;
for(int i=1;i<=5000;i++)p[i]=i;
for(int i=5000;i>1;i--)swap(p[i],p[rd()%i+1]);
}
std::vector<std::pair<int, int>> Alice(){
long long x=setN(5000);
gen();
op.push_back({1,2});
ls[0].push_back(1),ls[1].push_back(2);
for(int i=3;i<=n;i++){
op.push_back({p[ls[(x>>a[i])&1][rd()%ls[(x>>a[i])&1].size()]],p[i]});
ls[b[i]].push_back(i);
}
return op;
}
Bob
#include<bits/stdc++.h>
#include"Bob.h"
using namespace std;
// #define int long long
//#define mod 1000000007
#define N 5005
//#define pii pair<int,int>
#define fi first
#define se second
//#define rep(i,j,k) for(int i=j;i<=k;i++)
vector<std::pair<int, int>>op;
int a[N],b[N];
int n=5000;
mt19937 rd(156168);
int p[N],q[N];
void gen(){
for(int i=3;i<=5000;i++)a[i]=rd()%63;
b[1]=0,b[2]=1;
for(int i=3;i<=5000;i++)b[i]=rd()%2;
for(int i=1;i<=5000;i++)p[i]=i;
for(int i=5000;i>1;i--)swap(p[i],p[rd()%i+1]);
for(int i=1;i<=5000;i++)q[p[i]]=i;
}
long long Bob(std::vector<std::pair<int, int>> V){
gen();
long long ans=0;
for(auto op:V){
int u=op.fi,v=op.se;
u=q[u],v=q[v];
if(u>v)swap(u,v);
ans|=(b[u]<<a[v]);
}
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1952kb,1776kb
input:
1 4005
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1528 4716 4017 669 4017 3799 3799 1814 1814 2617 2617 4972 1814 1400 3799 4078 4078 660 1814 788 3799 4475 3799 339 4475 2852 788 3892 4475 3906 4475 4676 4017 ...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1528 4716 4017 669 4017 3799 3799 1814 1814 2617 2617 4972 1814 1400 3799 4078 4078 660 1814 788 3799 4475 3799 339 4475 2852 788 3892 4475 3906 4475 4676 4017 ...
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Output of encode is not a tree.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Output of encode is not a tree.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Output of encode is not a tree.
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1956kb,1780kb
input:
1 17476204
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4017 4716 4017 669 4017 3799 3799 1814 1814 2617 2617 4972 1814 1400 3799 4078 4078 660 1814 788 3799 4475 3799 339 4475 2852 788 3892 4475 3906 4475 4676 4017 ...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4017 4716 4017 669 4017 3799 3799 1814 1814 2617 2617 4972 1814 1400 3799 4078 4078 660 1814 788 3799 4475 3799 339 4475 2852 788 3892 4475 3906 4475 4676 4017 ...
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Output of encode is not a tree.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Output of encode is not a tree.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Output of encode is not a tree.
Subtask #3:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1952kb,1784kb
input:
1 355365355024496523
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1528 4716 1528 669 4017 3799 3799 1814 1814 2617 4017 4972 4972 1400 3799 4078 4972 660 1814 788 669 4475 3799 339 4475 2852 339 3892 3892 3906 3892 4676 669 31...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1528 4716 1528 669 4017 3799 3799 1814 1814 2617 4017 4972 4972 1400 3799 4078 4972 660 1814 788 669 4475 3799 339 4475 2852 339 3892 3892 3906 3892 4676 669 31...
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Output of encode is not a tree.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Output of encode is not a tree.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Output of encode is not a tree.