QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#557203 | #8726. Magic Show | Le0Chan | 0 | 1ms | 2000kb | C++20 | 1.7kb | 2024-09-11 08:07:55 | 2024-09-11 08:07:56 |
Alice
#include <bits/stdc++.h>
using namespace std;
#include "Alice.h"
#define LL long long
#define pii pair<int,int>
#define fi first
#define se second
std::vector<std::pair<int, int>> Alice();
long long setN(int n);
const int N=5003;
int bel[N];
mt19937 rd(0x2477264);
vector<pii> Alice(){
int n=4943;
LL V=setN(4943);
// LL V=4004;
vector<pii> as;
as.push_back({1,2});
for(int l=3;l<=4943;l+=61){
int now=l;
for(int i=0;i<=60;i++){
// cout<<now<<" ";
bel[now]=i;
now++;
}
// cout<<'\n';
}
shuffle(bel+3,bel+1+n,rd);
for(int i=3;i<=n;i++){
if(V&(1ll<<bel[i])) as.push_back({i,i-2});
else as.push_back({i,i-1});
}
return as;
}
// int main(){
// Alice();return 0;
// }
Bob
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
#define LL long long
#define pii pair<int,int>
#define fi first
#define se second
long long Bob(std::vector<std::pair<int, int>> V);
const int N=5e3+5;
bool vis[N];
int fa[N],ans[N],bel[N];
int n=4943;
vector<int> g[N];
void add(int x,int y){g[x].push_back(y);}
mt19937 rd(0x2477264);
LL Bob(vector<pii> as){
for(auto [x,y]:as){
if(x<y) fa[y]=x;
else fa[x]=y;
}
for(int l=3;l<=n;l+=61){
int now=l;
for(int j=0;j<=60;j++){
bel[now]=j;
now++;
}
}
shuffle(bel+3,bel+1+n,rd);
LL rs=0;
for(int i=3;i<=n;i++){
if(fa[i]) ans[bel[i]]=i-fa[i]-1;
}
for(int j=0;j<=60;j++) rs+=1ll<<ans[j];
return rs;
}
// int main(){
// Bob(vector<pii>());
// return 0;
// }
详细
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 1ms = 1ms + 0ms
memory: 1892kb,2000kb
input:
1 4005
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 2 4 3 5 4 6 5 7 5 8 7 9 8 10 9 11 10 12 10 13 12 14 13 15 14 16 15 17 16 18 16 19 17 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 26 29 28 30 29 31 29 3...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 2 4 3 5 4 6 5 7 5 8 7 9 8 10 9 11 10 12 10 13 12 14 13 15 14 16 15 17 16 18 16 19 17 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 26 29 28 30 29 31 29 3...
output:
2 4943 3940 2 3 3 4 4 5 5 6 5 7 7 8 8 9 9 10 10 11 10 12 12 13 13 14 14 15 15 16 16 17 16 18 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 28 28 29 29 30 29 31 31 32 31 33 33 34 35 36 35 37 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 48 50 50 51 50 52 51 53 54 55 54 56 56 57 58 ...
input:
2 4943 3940 2 3 3 4 4 5 5 6 5 7 7 8 8 9 9 10 10 11 10 12 12 13 13 14 14 15 15 16 16 17 16 18 19 20 20 21 21 22 22 23 23 24 24 25 25 26 26 28 28 29 29 30 29 31 31 32 31 33 33 34 35 36 35 37 38 39 39 40 40 41 41 42 42 43 43 44 44 45 45 46 46 47 47 48 48 49 48 50 50 51 50 52 51 53 54 55 54 56 56 57 58 ...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 69
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1892kb,1996kb
input:
1 17476204
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 2 4 3 5 4 6 5 7 5 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 16 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 3...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 2 4 3 5 4 6 5 7 5 8 7 9 8 10 9 11 10 12 11 13 12 14 13 15 14 16 15 17 16 18 16 19 18 20 19 21 20 22 21 23 22 24 23 25 24 26 25 27 26 28 27 29 28 30 29 31 30 3...
output:
2 4943 3940 2 3 3 4 4 5 5 6 5 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 16 18 19 20 20 21 21 22 22 23 23 24 24 25 25 26 27 28 28 29 29 30 30 31 31 32 32 33 33 34 35 36 35 37 38 39 39 40 40 41 40 42 42 43 42 44 43 45 45 46 45 47 46 48 47 49 48 50 49 51 51 52 52 53 54 55 54 56 56 57 58 ...
input:
2 4943 3940 2 3 3 4 4 5 5 6 5 7 7 8 8 9 9 10 10 11 11 12 12 13 13 14 14 15 15 16 16 17 16 18 19 20 20 21 21 22 22 23 23 24 24 25 25 26 27 28 28 29 29 30 30 31 31 32 32 33 33 34 35 36 35 37 38 39 39 40 40 41 40 42 42 43 42 44 43 45 45 46 45 47 46 48 47 49 48 50 49 51 51 52 52 53 54 55 54 56 56 57 58 ...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 72
Subtask #3:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1896kb,2000kb
input:
1 355365355024496523
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 2 4 3 5 4 6 4 7 6 8 6 9 8 10 8 11 9 12 10 13 11 14 13 15 14 16 14 17 15 18 17 19 17 20 19 21 19 22 21 23 21 24 23 25 23 26 24 27 26 28 26 29 28 30 28 31 29 32...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 2 4 3 5 4 6 4 7 6 8 6 9 8 10 8 11 9 12 10 13 11 14 13 15 14 16 14 17 15 18 17 19 17 20 19 21 19 22 21 23 21 24 23 25 23 26 24 27 26 28 26 29 28 30 28 31 29 32...
output:
2 4943 3940 2 3 3 4 4 5 4 6 6 7 6 8 8 9 8 10 9 11 10 12 11 13 13 14 14 15 14 16 15 17 17 18 19 20 19 21 21 22 21 23 23 24 23 25 24 26 26 28 28 29 28 30 29 31 30 32 31 33 32 34 34 36 36 37 37 39 38 40 39 41 41 42 42 43 42 44 44 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 54 55 55 56 55 57 57 5...
input:
2 4943 3940 2 3 3 4 4 5 4 6 6 7 6 8 8 9 8 10 9 11 10 12 11 13 13 14 14 15 14 16 15 17 17 18 19 20 19 21 21 22 21 23 23 24 23 25 24 26 26 28 28 29 28 30 29 31 30 32 31 33 32 34 34 36 36 37 37 39 38 40 39 41 41 42 42 43 42 44 44 45 44 46 45 47 46 48 47 49 48 50 49 51 50 52 51 53 54 55 55 56 55 57 57 5...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 94