QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#666162 | #8726. Magic Show | huazai676 | 0 | 1ms | 1916kb | C++17 | 2.0kb | 2024-10-22 16:52:46 | 2024-10-22 16:53:01 |
Alice
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<random>
#include "Alice.h"
using namespace std;
namespace
{
const int N=62,M=80;
typedef long long ll;
mt19937 rd(1723211);
int a[N*M+10];
int fa[N*M+10][2];
int rand(int l,int r)
{
return rd()%(r-l+1)+l;
}
}
vector<pair<int,int> > Alice()
{
vector<pair<int,int> > res;
ll x=setN(N*M+2);
int n=N*M+2;
for(int i=1;i<=n;i++) a[i]=i;
shuffle(a+1,a+n+1,rd);
for(int i=0;i<N;i++)
{
for(int j=1;j<=M;j++)
{
int u=(N-1-i)*M+j;
fa[u][1]=rand(u+1,n-1);
fa[u][0]=rand(fa[u][1]+1,n);
if(x>>i&1)
res.push_back({a[u],a[fa[u][1]]});
else
res.push_back({a[u],a[fa[u][0]]});
}
}
res.push_back({a[N*M+1],a[N*M+2]});
shuffle(res.begin(),res.end(),rd);
return res;
}
Bob
#include<iostream>
#include<cstring>
#include<algorithm>
#include<vector>
#include<random>
#include "Bob.h"
using namespace std;
namespace
{
const int N=65,M=78;
typedef long long ll;
int fa[N*M+10][2];
int f[N*M+10];
mt19937 rd(1723211);
int a[N*M+10],b[N*M+10];
int rand(int l,int r)
{
return rd()%(r-l+1)+l;
}
}
ll Bob(vector<pair<int,int> > V)
{
int n=N*M+2;
for(int i=1;i<=n;i++) a[i]=i;
shuffle(a+1,a+n+1,rd);
for(int i=1;i<=n;i++) b[a[i]]=i;
for(int i=0;i<N;i++)
{
for(int j=1;j<=M;j++)
{
int u=(N-1-i)*M+j;
fa[u][1]=rand(u+1,n-1);
fa[u][0]=rand(fa[u][1]+1,n);
}
}
for(auto[u,v]:V)
{
if(b[v]==fa[b[u]][1]) f[b[u]]=1;
}
ll res=0;
for(int i=0;i<N;i++)
{
ll g=0;
for(int j=1;j<=M;j++)
{
int u=(N-1-i)*M+j;
g|=f[u];
}
res|=g<<i;
}
return res;
}
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: 1888kb,1912kb
input:
1 4005
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4962 2698 594 1944 4065 4647 2099 3716 3915 2103 175 3128 1622 969 345 3636 3604 4299 4842 190 3870 3074 2778 108 3960 3689 2271 4274 4042 955 3073 3278 232 3386 3089 14...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4962 2698 594 1944 4065 4647 2099 3716 3915 2103 175 3128 1622 969 345 3636 3604 4299 4842 190 3870 3074 2778 108 3960 3689 2271 4274 4042 955 3073 3278 232 3386 3089 14...
output:
2 4962 3543 1 724 2 1177 2 1755 3 235 3 3915 4 1848 4 2355 4 3536 4 4460 5 3253 6 1672 7 3221 8 2916 9 4151 10 3518 11 4353 12 2548 13 1001 16 183 16 2632 16 3932 16 4554 17 597 17 2812 17 2870 17 3039 17 3279 17 3530 17 3828 17 4778 18 2875 19 2747 20 1232 21 270 22 1216 24 2246 24 3262 27 850 27 2...
input:
2 4962 3543 1 724 2 1177 2 1755 3 235 3 3915 4 1848 4 2355 4 3536 4 4460 5 3253 6 1672 7 3221 8 2916 9 4151 10 3518 11 4353 12 2548 13 1001 16 183 16 2632 16 3932 16 4554 17 597 17 2812 17 2870 17 3039 17 3279 17 3530 17 3828 17 4778 18 2875 19 2747 20 1232 21 270 22 1216 24 2246 24 3262 27 850 27 2...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 8192
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1892kb,1916kb
input:
1 17476204
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4962 2698 594 1944 214 4647 2099 3716 3915 2103 175 3128 1622 969 345 3636 3604 4299 3551 190 3789 3074 2778 108 3960 3689 2271 4274 4042 955 3073 3278 232 3386 3089 143...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4962 2698 594 1944 214 4647 2099 3716 3915 2103 175 3128 1622 969 345 3636 3604 4299 3551 190 3789 3074 2778 108 3960 3689 2271 4274 4042 955 3073 3278 232 3386 3089 143...
output:
2 4962 3543 1 724 2 1177 2 1755 3 235 3 3915 4 1848 4 2355 4 3536 4 4460 5 3253 6 1672 7 3221 8 2916 9 4151 10 3518 11 4353 12 2548 13 1001 16 2632 16 2997 16 3932 16 4554 17 2812 17 2870 17 3039 17 3178 17 3828 17 4422 18 2875 19 2747 20 1232 21 270 21 1540 22 1216 24 2246 24 3262 27 2358 27 3065 2...
input:
2 4962 3543 1 724 2 1177 2 1755 3 235 3 3915 4 1848 4 2355 4 3536 4 4460 5 3253 6 1672 7 3221 8 2916 9 4151 10 3518 11 4353 12 2548 13 1001 16 2632 16 2997 16 3932 16 4554 17 2812 17 2870 17 3039 17 3178 17 3828 17 4422 18 2875 19 2747 20 1232 21 270 21 1540 22 1216 24 2246 24 3262 27 2358 27 3065 2...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 40960
Subtask #3:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 1ms = 1ms + 0ms
memory: 1892kb,1912kb
input:
1 355365355024496523
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4962 2698 594 1944 4065 4647 1060 3716 2794 2103 175 3128 3543 969 345 3636 3604 4299 3551 190 3870 3074 2778 108 3960 3689 2271 4274 4042 955 687 3278 3584 3386 4941 14...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4962 2698 594 1944 4065 4647 1060 3716 2794 2103 175 3128 3543 969 345 3636 3604 4299 3551 190 3870 3074 2778 108 3960 3689 2271 4274 4042 955 687 3278 3584 3386 4941 14...
output:
2 4962 3543 1 724 2 1177 2 3246 3 1048 4 2355 4 3536 4 3657 5 2778 6 1672 7 1053 8 2916 9 3674 10 1041 11 2696 12 2548 13 2205 14 3871 16 183 16 3932 16 4554 17 350 17 597 17 2870 17 3039 17 3178 17 3279 17 3523 17 3530 17 3723 17 3828 17 4778 18 1461 18 2875 19 571 20 1232 21 270 22 626 22 1397 24 ...
input:
2 4962 3543 1 724 2 1177 2 3246 3 1048 4 2355 4 3536 4 3657 5 2778 6 1672 7 1053 8 2916 9 3674 10 1041 11 2696 12 2548 13 2205 14 3871 16 183 16 3932 16 4554 17 350 17 597 17 2870 17 3039 17 3178 17 3279 17 3523 17 3530 17 3723 17 3828 17 4778 18 1461 18 2875 19 571 20 1232 21 270 22 626 22 1397 24 ...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 32768