QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#557189 | #8726. Magic Show | Le0Chan | 0 | 0ms | 1972kb | C++20 | 1.4kb | 2024-09-11 07:56:24 | 2024-09-11 07:56:24 |
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);
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<<" ";
if(V&(1ll<<i)) as.push_back({now,now-2});
else as.push_back({now,now-1});
now++;
}
// cout<<'\n';
}
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];
int n=4943;
vector<int> g[N];
void add(int x,int y){g[x].push_back(y);}
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++){
if(fa[now]){
ans[j]=now-fa[now]-1;
}
now++;
}
}
LL rs=0;
for(int j=0;j<=60;j++) rs+=1ll<<ans[j];
return rs;
}
// int main(){
// Bob(vector<pii>());
// return 0;
// }
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: 1872kb,1968kb
input:
1 4005
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 1 4 3 5 3 6 5 7 6 8 6 9 8 10 8 11 9 12 10 13 11 14 12 15 14 16 15 17 16 18 17 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 32...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 1 4 3 5 3 6 5 7 6 8 6 9 8 10 8 11 9 12 10 13 11 14 12 15 14 16 15 17 16 18 17 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 32...
output:
2 4943 3818 3 4 3 5 6 7 6 8 8 10 10 12 11 13 12 14 14 15 15 16 17 18 18 19 19 20 20 21 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 58 59 59 60 60 61 61 ...
input:
2 4943 3818 3 4 3 5 6 7 6 8 8 10 10 12 11 13 12 14 14 15 15 16 17 18 18 19 19 20 20 21 22 23 23 24 24 25 25 26 26 27 27 28 28 29 29 30 30 31 31 32 32 33 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 58 59 59 60 60 61 61 ...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 69
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1864kb,1972kb
input:
1 17476204
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 2 4 3 5 3 6 4 7 6 8 6 9 7 10 9 11 10 12 10 13 12 14 12 15 14 16 14 17 16 18 16 19 18 20 18 21 20 22 20 23 22 24 23 25 24 26 25 27 25 28 27 29 28 30 29 31 30 3...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 2 4 3 5 3 6 4 7 6 8 6 9 7 10 9 11 10 12 10 13 12 14 12 15 14 16 14 17 16 18 16 19 18 20 18 21 20 22 20 23 22 24 23 25 24 26 25 27 25 28 27 29 28 30 29 31 30 3...
output:
2 4943 3818 3 4 3 5 6 7 6 8 9 10 10 12 12 13 12 14 14 15 14 16 16 18 18 19 18 20 20 21 22 23 23 24 24 25 25 26 25 27 27 28 28 29 29 30 30 31 31 32 32 33 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 58 59 59 60 60 61 61 ...
input:
2 4943 3818 3 4 3 5 6 7 6 8 9 10 10 12 12 13 12 14 14 15 14 16 16 18 18 19 18 20 20 21 22 23 23 24 24 25 25 26 25 27 27 28 28 29 29 30 30 31 31 32 32 33 34 35 35 36 36 37 37 38 38 39 39 40 40 41 41 42 43 44 44 45 45 46 46 47 47 48 48 49 49 50 50 51 51 52 52 53 53 54 54 55 55 56 58 59 59 60 60 61 61 ...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 72
Subtask #3:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1868kb,1972kb
input:
1 355365355024496523
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 1 4 2 5 4 6 4 7 6 8 7 9 8 10 8 11 9 12 10 13 11 14 13 15 13 16 14 17 16 18 17 19 17 20 18 21 19 22 21 23 21 24 22 25 24 26 24 27 25 28 26 29 27 30 29 31 29 32...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 4943 1 2 3 1 4 2 5 4 6 4 7 6 8 7 9 8 10 8 11 9 12 10 13 11 14 13 15 13 16 14 17 16 18 17 19 17 20 18 21 19 22 21 23 21 24 22 25 24 26 24 27 25 28 26 29 27 30 29 31 29 32...
output:
2 4943 3818 2 4 4 5 6 7 7 8 8 10 10 12 11 13 13 14 13 15 14 16 17 18 17 19 18 20 19 21 21 23 22 24 24 25 24 26 25 27 26 28 27 29 29 30 29 31 31 32 31 33 34 35 35 36 36 37 36 38 38 39 38 40 39 41 40 42 42 44 44 45 45 46 46 47 47 48 48 49 48 50 50 51 50 52 51 53 52 54 54 55 54 56 58 59 59 60 59 61 61 ...
input:
2 4943 3818 2 4 4 5 6 7 7 8 8 10 10 12 11 13 13 14 13 15 14 16 17 18 17 19 18 20 19 21 21 23 22 24 24 25 24 26 25 27 26 28 27 29 29 30 29 31 31 32 31 33 34 35 35 36 36 37 36 38 38 39 38 40 39 41 40 42 42 44 44 45 45 46 46 47 47 48 48 49 48 50 50 51 50 52 51 53 52 54 54 55 54 56 58 59 59 60 59 61 61 ...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 94