QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#601261 | #8726. Magic Show | xwh_Marvelous | 0 | 1ms | 1956kb | C++14 | 1.6kb | 2024-09-29 21:57:07 | 2024-09-29 21:57:08 |
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=1;i<=5000;i++)swap(p[i],p[rd()%5000+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=1;i<=5000;i++)swap(p[i],p[rd()%5000+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: 1ms = 1ms + 0ms
memory: 1956kb,1780kb
input:
1 4005
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1866 4245 1697 2189 1697 1876 1697 1422 1697 646 1866 1763 1697 1913 1422 2520 1422 3647 3647 4735 1422 3150 3150 1137 4735 2898 3150 721 3150 3098 1697 3583 18...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1866 4245 1697 2189 1697 1876 1697 1422 1697 646 1866 1763 1697 1913 1422 2520 1422 3647 3647 4735 1422 3150 3150 1137 4735 2898 3150 721 3150 3098 1697 3583 18...
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: 1948kb,1780kb
input:
1 17476204
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1697 4245 1697 2189 1697 1876 1697 1422 1697 646 1866 1763 1697 1913 1422 2520 1422 3647 3647 4735 1422 3150 3150 1137 4735 2898 3150 721 3150 3098 1697 3583 18...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1697 4245 1697 2189 1697 1876 1697 1422 1697 646 1866 1763 1697 1913 1422 2520 1422 3647 3647 4735 1422 3150 3150 1137 4735 2898 3150 721 3150 3098 1697 3583 18...
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: 1948kb,1896kb
input:
1 355365355024496523
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1866 4245 4245 2189 1697 1876 1697 1422 1697 646 1422 1763 4245 1913 1422 2520 2189 3647 3647 4735 4245 3150 3150 1137 4735 2898 646 721 721 3098 1866 3583 3583...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 1866 4245 4245 2189 1697 1876 1697 1422 1697 646 1422 1763 4245 1913 1422 2520 2189 3647 3647 4735 4245 3150 3150 1137 4735 2898 646 721 721 3098 1866 3583 3583...
output:
2 5000 2938 1 2 1 586 1 1836 1 4904 3 2035 5 998 7 3708 7 4836 8 2044 8 4569 10 1737 11 1773 12 4644 14 3885 15 4178 16 3741 20 2997 20 3071 20 3618 22 1052 22 1128 22 4679 23 3303 24 4053 25 1948 25 3990 26 2789 27 1676 28 2808 29 360 30 3379 31 36 31 2950 31 3040 31 3229 33 458 34 1038 38 477 39 2...
input:
2 5000 2938 1 2 1 586 1 1836 1 4904 3 2035 5 998 7 3708 7 4836 8 2044 8 4569 10 1737 11 1773 12 4644 14 3885 15 4178 16 3741 20 2997 20 3071 20 3618 22 1052 22 1128 22 4679 23 3303 24 4053 25 1948 25 3990 26 2789 27 1676 28 2808 29 360 30 3379 31 36 31 2950 31 3040 31 3229 33 458 34 1038 38 477 39 2...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 1476376555