QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#480462 | #8726. Magic Show | HHHashmap | 0 | 1ms | 1996kb | C++14 | 1.9kb | 2024-07-16 15:51:20 | 2024-07-16 15:51:21 |
Alice
#include "Alice.h"
#include <bits/stdc++.h>
using namespace std;
int cnt=0;
vector<std::pair<int, int>> Alice()
{
long long X,d;cnt++;
int bit[5010],tr[5010],now=0,tnow=0,tcnt=0;
pair<int,int> sid[5010];
vector<int> ibit[70];
vector<pair<int,int>> ret;
queue<int> Q;
for(int i=0;i<=60;i++) ibit[i].clear();
mt19937 rd(114236+cnt);
for(int i=3;i<=5000;i++)
{
bit[i]=tnow;
tcnt++;
if(tcnt==83&&tnow<59) tnow++,tcnt=0;
}
shuffle(bit+3,bit+5000,rd);
for(int i=3;i<=5000;i++) tr[i]=rd()%2+1;
for(int i=3;i<=5000;i++) ibit[bit[i]].push_back(i);
X=setN(5000);
while(!Q.empty()) Q.pop();
while(X)
{
d=__lg(X);
Q.push(d);
X-=(1ll<<d);
}
for(int i=59;i>=0;i--)
{
if(i==Q.front())
{
Q.pop();
for(auto to:ibit[i]) sid[++now]={to,tr[to]};
continue;
}
for(auto to:ibit[i]) sid[++now]={to,3-tr[to]};
}
shuffle(sid+1,sid+1+now,rd);ret.clear();ret.push_back({1,2});
for(int i=1;i<=now;i++)
{
if(rd()%2==0) swap(sid[i].first,sid[i].second);
ret.push_back({sid[i].first,sid[i].second});
}
return ret;
}
Bob
#include "Bob.h"
#include <bits/stdc++.h>
using namespace std;
int cnt2=0;
long long Bob(std::vector<std::pair<int, int>> V)
{
cnt2++;
int bit2[5010],tr2[5010],res2[70],tnow=0,tcnt=0;
for(int i=0;i<=60;i++) res2[i]=0;
mt19937 rd(114236+cnt2);
for(int i=3;i<=5000;i++)
{
bit2[i]=tnow;
tcnt++;
if(tcnt==83&&tnow<59) tnow++,tcnt=0;
}
shuffle(bit2+3,bit2+5000,rd);
for(int i=3;i<=5000;i++) tr2[i]=rd()%2+1;
int m,x,y;
for(int i=0;i<V.size();i++)
{
x=V[i].first;y=V[i].second;
if(x<y) swap(x,y);
if(x==2&&y==1) continue;
if(tr2[x]==y) res2[bit2[x]]=1;
}
long long ans=0,dd=1;
for(int i=0;i<=59;i++)
{
if(res2[i]) ans+=dd;
dd*=2ll;
}
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1992kb,1844kb
input:
1 4005
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 1 621 1 1089 3379 2 1155 1 1 71 4675 2 2 2998 2 3519 1 421 2 4399 4091 1 2 3089 3057 2 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 1 621 1 1089 3379 2 1155 1 1 71 4675 2 2 2998 2 3519 1 421 2 4399 4091 1 2 3089 3057 2 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
output:
2 5000 2553 1 7 1 8 1 11 1 18 1 23 1 30 1 31 1 37 1 40 1 46 1 50 1 51 1 54 1 57 1 58 1 59 1 63 1 70 1 71 1 73 1 75 1 77 1 81 1 91 1 95 1 103 1 106 1 107 1 112 1 116 1 117 1 124 1 127 1 128 1 129 1 133 1 134 1 135 1 136 1 139 1 153 1 159 1 161 1 163 1 165 1 166 1 170 1 172 1 173 1 174 1 179 1 185 1 1...
input:
2 5000 2553 1 7 1 8 1 11 1 18 1 23 1 30 1 31 1 37 1 40 1 46 1 50 1 51 1 54 1 57 1 58 1 59 1 63 1 70 1 71 1 73 1 75 1 77 1 81 1 91 1 95 1 103 1 106 1 107 1 112 1 116 1 117 1 124 1 127 1 128 1 129 1 133 1 134 1 135 1 136 1 139 1 153 1 159 1 161 1 163 1 165 1 166 1 170 1 172 1 173 1 174 1 179 1 185 1 1...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 4005
Test #2:
score: 5
Accepted
time: 1ms = 1ms + 0ms
memory: 1988kb,1844kb
input:
1 459
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 2 621 2 1089 3379 1 1155 2 1 71 4675 2 2 2998 2 3519 1 421 2 4399 4091 1 2 3089 3057 2 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 2 621 2 1089 3379 1 1155 2 1 71 4675 2 2 2998 2 3519 1 421 2 4399 4091 1 2 3089 3057 2 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
output:
2 5000 2553 1 7 1 8 1 11 1 18 1 23 1 30 1 31 1 37 1 46 1 47 1 50 1 51 1 54 1 57 1 58 1 59 1 63 1 69 1 70 1 71 1 73 1 75 1 77 1 81 1 91 1 95 1 103 1 106 1 107 1 116 1 117 1 124 1 127 1 128 1 129 1 133 1 134 1 135 1 136 1 139 1 146 1 150 1 153 1 154 1 159 1 161 1 162 1 165 1 166 1 170 1 172 1 173 1 17...
input:
2 5000 2553 1 7 1 8 1 11 1 18 1 23 1 30 1 31 1 37 1 46 1 47 1 50 1 51 1 54 1 57 1 58 1 59 1 63 1 69 1 70 1 71 1 73 1 75 1 77 1 81 1 91 1 95 1 103 1 106 1 107 1 116 1 117 1 124 1 127 1 128 1 129 1 133 1 134 1 135 1 136 1 139 1 146 1 150 1 153 1 154 1 159 1 161 1 162 1 165 1 166 1 170 1 172 1 173 1 17...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 459
Test #3:
score: 5
Accepted
time: 0ms = 0ms + 0ms
memory: 1988kb,1848kb
input:
1 2495
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 2 621 2 1089 3379 2 1155 1 1 71 4675 2 2 2998 2 3519 1 421 2 4399 4091 1 2 3089 3057 2 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 2 621 2 1089 3379 2 1155 1 1 71 4675 2 2 2998 2 3519 1 421 2 4399 4091 1 2 3089 3057 2 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
output:
2 5000 2553 1 7 1 8 1 11 1 18 1 23 1 30 1 31 1 37 1 40 1 46 1 47 1 50 1 54 1 57 1 58 1 59 1 63 1 69 1 70 1 71 1 73 1 75 1 81 1 91 1 95 1 103 1 106 1 107 1 112 1 116 1 117 1 124 1 127 1 128 1 129 1 133 1 134 1 135 1 136 1 139 1 146 1 153 1 154 1 159 1 161 1 165 1 166 1 170 1 172 1 173 1 174 1 179 1 1...
input:
2 5000 2553 1 7 1 8 1 11 1 18 1 23 1 30 1 31 1 37 1 40 1 46 1 47 1 50 1 54 1 57 1 58 1 59 1 63 1 69 1 70 1 71 1 73 1 75 1 81 1 91 1 95 1 103 1 106 1 107 1 112 1 116 1 117 1 124 1 127 1 128 1 129 1 133 1 134 1 135 1 136 1 139 1 146 1 153 1 154 1 159 1 161 1 165 1 166 1 170 1 172 1 173 1 174 1 179 1 1...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 2495
Test #4:
score: 0
Wrong Answer
time: 1ms = 1ms + 0ms
memory: 1992kb,1844kb
input:
3 1560
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 3 5000 1 2 4866 2 1194 1 1 621 1 1089 3379 1 1155 2 1 71 4675 2 2 2998 2 3519 1 421 2 4399 4091 1 2 3089 3057 2 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 3 5000 1 2 4866 2 1194 1 1 621 1 1089 3379 1 1155 2 1 71 4675 2 2 2998 2 3519 1 421 2 4399 4091 1 2 3089 3057 2 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
output:
4 5000 2537 1 2 2 4 2 5 2 6 2 9 2 10 2 13 2 15 2 16 2 19 2 24 2 25 2 26 2 27 2 28 2 32 2 33 2 35 2 36 2 38 2 39 2 42 2 44 2 45 2 48 2 49 2 51 2 52 2 53 2 56 2 60 2 61 2 62 2 64 2 65 2 66 2 69 2 72 2 74 2 76 2 77 2 78 2 79 2 80 2 82 2 83 2 84 2 86 2 88 2 93 2 94 2 96 2 97 2 98 2 99 2 101 2 102 2 108 ...
input:
4 5000 2537 1 2 2 4 2 5 2 6 2 9 2 10 2 13 2 15 2 16 2 19 2 24 2 25 2 26 2 27 2 28 2 32 2 33 2 35 2 36 2 38 2 39 2 42 2 44 2 45 2 48 2 49 2 51 2 52 2 53 2 56 2 60 2 61 2 62 2 64 2 65 2 66 2 69 2 72 2 74 2 76 2 77 2 78 2 79 2 80 2 82 2 83 2 84 2 86 2 88 2 93 2 94 2 96 2 97 2 98 2 99 2 101 2 102 2 108 ...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 1561
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1996kb,1844kb
input:
1 17476204
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 1 621 1 1089 3379 2 1155 1 1 71 4675 2 2 2998 2 3519 2 421 2 4399 4091 1 2 3089 3057 1 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 1 621 1 1089 3379 2 1155 1 1 71 4675 2 2 2998 2 3519 2 421 2 4399 4091 1 2 3089 3057 1 2 2775 1 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 2 1 21...
output:
2 5000 2553 1 3 1 8 1 11 1 18 1 23 1 30 1 31 1 37 1 46 1 47 1 50 1 51 1 54 1 56 1 57 1 58 1 59 1 63 1 70 1 71 1 73 1 75 1 77 1 81 1 91 1 92 1 95 1 103 1 106 1 107 1 112 1 116 1 119 1 124 1 127 1 128 1 133 1 134 1 136 1 139 1 146 1 154 1 159 1 161 1 165 1 166 1 170 1 172 1 174 1 185 1 193 1 196 1 201...
input:
2 5000 2553 1 3 1 8 1 11 1 18 1 23 1 30 1 31 1 37 1 46 1 47 1 50 1 51 1 54 1 56 1 57 1 58 1 59 1 63 1 70 1 71 1 73 1 75 1 77 1 81 1 91 1 92 1 95 1 103 1 106 1 107 1 112 1 116 1 119 1 124 1 127 1 128 1 133 1 134 1 136 1 139 1 146 1 154 1 159 1 161 1 165 1 166 1 170 1 172 1 174 1 185 1 193 1 196 1 201...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 17476205
Subtask #3:
score: 0
Wrong Answer
Test #25:
score: 65
Accepted
time: 0ms = 0ms + 0ms
memory: 1988kb,1848kb
input:
1 355365355024496523
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 2 2 621 2 1089 3379 1 1155 2 2 71 4675 2 1 2998 1 3519 2 421 2 4399 4091 1 2 3089 3057 1 2 2775 1 3445 1 4071 1468 2 1988 1 461 2 1 2931 3405 2 1 21...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 2 2 621 2 1089 3379 1 1155 2 2 71 4675 2 1 2998 1 3519 2 421 2 4399 4091 1 2 3089 3057 1 2 2775 1 3445 1 4071 1468 2 1988 1 461 2 1 2931 3405 2 1 21...
output:
2 5000 2553 1 8 1 10 1 15 1 18 1 25 1 26 1 27 1 39 1 40 1 42 1 47 1 51 1 53 1 56 1 57 1 60 1 64 1 69 1 70 1 72 1 74 1 75 1 77 1 94 1 95 1 98 1 102 1 106 1 117 1 119 1 123 1 127 1 129 1 133 1 134 1 135 1 139 1 142 1 150 1 153 1 161 1 162 1 165 1 167 1 170 1 173 1 174 1 175 1 179 1 181 1 193 1 196 1 2...
input:
2 5000 2553 1 8 1 10 1 15 1 18 1 25 1 26 1 27 1 39 1 40 1 42 1 47 1 51 1 53 1 56 1 57 1 60 1 64 1 69 1 70 1 72 1 74 1 75 1 77 1 94 1 95 1 98 1 102 1 106 1 117 1 119 1 123 1 127 1 129 1 133 1 134 1 135 1 139 1 142 1 150 1 153 1 161 1 162 1 165 1 167 1 170 1 173 1 174 1 175 1 179 1 181 1 193 1 196 1 2...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 355365355024496523
Test #26:
score: 0
Wrong Answer
time: 0ms = 0ms + 0ms
memory: 1996kb,1844kb
input:
1 727827999106414164
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 1 621 1 1089 3379 1 1155 2 2 71 4675 1 2 2998 1 3519 2 421 2 4399 4091 2 2 3089 3057 1 2 2775 2 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 1 2 21...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 1 2 4866 2 1194 1 1 621 1 1089 3379 1 1155 2 2 71 4675 1 2 2998 1 3519 2 421 2 4399 4091 2 2 3089 3057 1 2 2775 2 3445 1 4071 1468 2 1988 1 461 1 2 2931 3405 1 2 21...
output:
2 5000 2553 1 3 1 4 1 8 1 10 1 11 1 16 1 18 1 23 1 25 1 27 1 28 1 30 1 31 1 42 1 46 1 49 1 50 1 54 1 57 1 58 1 59 1 63 1 70 1 73 1 74 1 79 1 81 1 91 1 92 1 94 1 98 1 101 1 103 1 107 1 110 1 116 1 119 1 120 1 124 1 128 1 135 1 136 1 144 1 151 1 159 1 163 1 172 1 182 1 185 1 196 1 203 1 204 1 206 1 21...
input:
2 5000 2553 1 3 1 4 1 8 1 10 1 11 1 16 1 18 1 23 1 25 1 27 1 28 1 30 1 31 1 42 1 46 1 49 1 50 1 54 1 57 1 58 1 59 1 63 1 70 1 73 1 74 1 79 1 81 1 91 1 92 1 94 1 98 1 101 1 103 1 107 1 110 1 116 1 119 1 120 1 124 1 128 1 135 1 136 1 144 1 151 1 159 1 163 1 172 1 182 1 185 1 196 1 203 1 204 1 206 1 21...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 727827999106414165