QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#592947 | #8726. Magic Show | -Ofast | 0 | 0ms | 1920kb | C++20 | 1.6kb | 2024-09-27 10:27:48 | 2024-09-27 10:27:49 |
Alice
#include <bits/stdc++.h>
#define mp make_pair
#define fir first
#define sec second
using namespace std;
long long setN(int n);
int fa[5005],vis[5005];
vector <pair<int,int>> Alice(){
mt19937 rnd(20080511);
mt19937 rnd2(19911225);
unsigned long long X=setN(4098);
vector <int> id;
for(int i=0;i<4096;i++)
id.push_back(i+3);
shuffle(id.begin(),id.end(),rnd);
for(int i=0;i<4096;i++)vis[i+3]=rnd2()&1;
vector <pair<int,int>> res;
res.push_back(mp(2,1));fa[2]=1;
int cnt=0;
for(int i=0;i<4096;i+=64){
for(int j=i;j<i+64;j++){
fa[id[j]]=rnd()%(id[j]/2)+1;
if(((X>>cnt)&1)^vis[id[j]]){
fa[id[j]]+=(id[j]/2);
if(fa[id[j]]==id[j])fa[id[j]]--;
}
}
cnt++;
}
for(int i=3;i<=4098;i++)
res.push_back(mp(i,fa[i]));
return res;
}
/*
int main(){
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
Alice();
return 0;
}
*/
Bob
#include <bits/stdc++.h>
#define mp make_pair
#define fir first
#define sec second
using namespace std;
int fa[5005],inv[5005],vis[5005];
long long Bob(vector <pair<int,int>> p){
mt19937 rnd(20080511);
mt19937 rnd2(19911225);
vector <int> id;
for(int i=0;i<4096;i++)
id.push_back(i+3);
shuffle(id.begin(),id.end(),rnd);
for(int i=0;i<4096;i++)vis[i+3]=rnd2()&1;
for(int i=0;i<4096;i++)
inv[id[i]]=i/64;
unsigned long long ans=0;
for(auto it:p){
if(it.fir==2)continue;
if((it.sec>it.fir/2)^vis[it.fir])
ans|=1ull<<(inv[it.fir]);
}
return ans;
}
/*
int main(){
ios::sync_with_stdio(false);cin.tie(0);cout.tie(0);
Bob();
return 0;
}
*/
詳細信息
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1920kb,1904kb
input:
1 4005
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4098 2 1 3 1 4 1 5 2 6 2 7 3 8 5 9 1 10 7 11 5 12 6 13 11 14 12 15 14 16 1 17 13 18 10 19 13 20 12 21 16 22 20 23 10 24 9 25 24 26 22 27 18 28 10 29 7 30 2 31 28 32 17 3...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4098 2 1 3 1 4 1 5 2 6 2 7 3 8 5 9 1 10 7 11 5 12 6 13 11 14 12 15 14 16 1 17 13 18 10 19 13 20 12 21 16 22 20 23 10 24 9 25 24 26 22 27 18 28 10 29 7 30 2 31 28 32 17 3...
output:
2 4098 3895 1 2 1 3 1 4 1 9 1 49 1 54 1 194 1 592 1 922 2 5 2 6 2 30 2 397 3 7 3 33 3 37 3 113 3 135 3 142 3 190 3 304 3 385 3 450 3 773 3 796 4 35 4 1034 5 8 5 11 5 38 5 2436 6 12 6 50 6 60 6 66 6 85 6 131 6 205 6 329 6 1294 6 3717 7 10 7 29 7 80 7 715 8 164 8 398 8 559 8 589 8 1296 8 1847 8 2650 8...
input:
2 4098 3895 1 2 1 3 1 4 1 9 1 49 1 54 1 194 1 592 1 922 2 5 2 6 2 30 2 397 3 7 3 33 3 37 3 113 3 135 3 142 3 190 3 304 3 385 3 450 3 773 3 796 4 35 4 1034 5 8 5 11 5 38 5 2436 6 12 6 50 6 60 6 66 6 85 6 131 6 205 6 329 6 1294 6 3717 7 10 7 29 7 80 7 715 8 164 8 398 8 559 8 589 8 1296 8 1847 8 2650 8...
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Incorrect answer.
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1916kb,1908kb
input:
1 17476204
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4098 2 1 3 1 4 1 5 2 6 2 7 3 8 5 9 1 10 7 11 5 12 11 13 11 14 12 15 7 16 9 17 13 18 1 19 4 20 12 21 16 22 20 23 10 24 9 25 24 26 9 27 5 28 10 29 7 30 2 31 28 32 17 33 19...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4098 2 1 3 1 4 1 5 2 6 2 7 3 8 5 9 1 10 7 11 5 12 11 13 11 14 12 15 7 16 9 17 13 18 1 19 4 20 12 21 16 22 20 23 10 24 9 25 24 26 9 27 5 28 10 29 7 30 2 31 28 32 17 33 19...
output:
2 4098 3895 1 2 1 3 1 4 1 9 1 18 1 49 1 54 1 194 1 592 1 922 2 5 2 6 2 30 2 397 3 7 3 37 3 113 3 135 3 142 3 154 3 190 3 304 3 385 3 450 3 773 3 2767 4 19 4 89 4 249 5 8 5 11 5 27 5 38 6 50 6 60 6 66 6 85 6 603 6 3717 7 10 7 15 7 29 7 80 7 715 8 86 8 164 8 322 8 589 8 1296 8 1847 8 2650 8 3770 9 24 ...
input:
2 4098 3895 1 2 1 3 1 4 1 9 1 18 1 49 1 54 1 194 1 592 1 922 2 5 2 6 2 30 2 397 3 7 3 37 3 113 3 135 3 142 3 154 3 190 3 304 3 385 3 450 3 773 3 2767 4 19 4 89 4 249 5 8 5 11 5 27 5 38 6 50 6 60 6 66 6 85 6 603 6 3717 7 10 7 15 7 29 7 80 7 715 8 86 8 164 8 322 8 589 8 1296 8 1847 8 2650 8 3770 9 24 ...
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Incorrect answer.
Subtask #3:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1916kb,1900kb
input:
1 355365355024496523
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4098 2 1 3 2 4 1 5 4 6 5 7 6 8 5 9 5 10 7 11 10 12 11 13 11 14 5 15 7 16 9 17 5 18 10 19 4 20 12 21 6 22 9 23 21 24 21 25 24 26 9 27 5 28 24 29 21 30 2 31 13 32 17 33 3 ...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4098 2 1 3 2 4 1 5 4 6 5 7 6 8 5 9 5 10 7 11 10 12 11 13 11 14 5 15 7 16 9 17 5 18 10 19 4 20 12 21 6 22 9 23 21 24 21 25 24 26 9 27 5 28 24 29 21 30 2 31 13 32 17 33 3 ...
output:
2 4098 3895 1 2 1 4 1 49 1 194 1 537 1 922 2 3 2 30 2 59 2 397 2 2721 3 33 3 113 3 154 3 385 3 450 3 796 3 2252 3 2767 4 5 4 19 4 41 4 56 4 93 4 162 4 232 4 249 4 376 4 1034 5 6 5 8 5 9 5 14 5 17 5 27 5 51 5 82 5 168 5 1452 5 2436 5 2511 6 7 6 21 6 50 6 60 6 66 6 205 6 329 6 1294 6 3717 7 10 7 15 7 ...
input:
2 4098 3895 1 2 1 4 1 49 1 194 1 537 1 922 2 3 2 30 2 59 2 397 2 2721 3 33 3 113 3 154 3 385 3 450 3 796 3 2252 3 2767 4 5 4 19 4 41 4 56 4 93 4 162 4 232 4 249 4 376 4 1034 5 6 5 8 5 9 5 14 5 17 5 27 5 51 5 82 5 168 5 1452 5 2436 5 2511 6 7 6 21 6 50 6 60 6 66 6 205 6 329 6 1294 6 3717 7 10 7 15 7 ...
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Incorrect answer.