QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#668700 | #8726. Magic Show | _Alexande_ | 0 | 7ms | 33064kb | C++14 | 2.3kb | 2024-10-23 15:32:37 | 2024-10-23 15:32:38 |
Judging History
Alice
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
mt19937 rnd1 ( 114514 ), rnd2 ( 191981 ), rnd3 ( 998244 );
const int N = 5005;
int n = 5000;
int rd[N], dad1[N], dad2[N];
vector < pair < int, int > > e;
vector < pair < int, int > > Alice () {
long long x = setN ( 5000 );
for ( int i = 1; i <= n; i ++ ) {
rd[i] = i;
}
srand ( rnd3 () );
random_shuffle ( rd + 1, rd + 1 + n );
for ( int i = 2; i <= n; i ++ ) {
dad1[i] = rnd1 () % ( i - 1 ) + 1;
dad2[i] = rnd2 () % ( i - 1 ) + 1;
}
for ( int i = 2; i <= 80; i ++ ) {
e.push_back ( { i, rnd3 () % ( i - 1 ) + 1 } );
}
int len = 80;
for ( int i = 1; i <= 80; i ++ ) {
for ( int j = 0; j <= 60; j ++ ) {
len ++;
if ( ( 1ll << j ) & x ) {
e.push_back ( { len, dad1[len] } );
}
else {
e.push_back ( { len, dad2[len] } );
}
}
}
for ( int i = len + 1; i <= 5000; i ++ ) {
e.push_back ( { i, rnd3 () % ( i - 1 ) + 1 } );
}
vector < pair < int, int > > ans;
for ( pair < int, int > tmp : e ) {
ans.push_back ( { rd[tmp.first], rd[tmp.second] } );
}
return ans;
}
Bob
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
mt19937 rndd1 ( 114514 ), rndd2 ( 191981 ), rndd3 ( 998244 );
const int N = 5005;
int nn = 5000;
int rdd[N], dadd1[N], dadd2[N];
int mp[N][N], p[N];
long long Bob ( vector < pair < int, int > > e ) {
for ( int i = 1; i <= nn; i ++ ) {
rdd[i] = i;
}
srand ( rndd3 () );
random_shuffle ( rdd + 1, rdd + 1 + nn );
for ( int i = 2; i <= nn; i ++ ) {
dadd1[i] = rndd1 () % ( i - 1 ) + 1;
dadd2[i] = rndd2 () % ( i - 1 ) + 1;
}
for ( pair < int, int > tmp : e ) {
mp[tmp.first][tmp.second] = mp[tmp.second][tmp.first] = 1;
}
int len = 0;
for ( int i = 1; i <= 80; i ++ ) {
for ( int j = 0; j <= 60; j ++ ) {
len ++;
if ( mp[len][dadd1[len]] ) {
p[j] = 1;
}
}
}
long long x;
for ( int i = 0; i <= 60; i ++ ) {
if ( p[i] ) {
x += 1ll << i;
}
}
return x;
}
Details
Tip: Click on the bar to expand more detailed information
Subtask #1:
score: 0
Wrong Answer
Test #1:
score: 0
Wrong Answer
time: 7ms = 1ms + 6ms
memory: 1956kb,33044kb
input:
1 4005
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 316 4770 973 4770 4910 316 2496 4770 3855 973 2508 3855 4834 316 480 316 3581 316 2266 2496 4567 973 2692 4567 2863 2508 2030 3581 1601 973 977 3581 4512 4770 3696 ...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 316 4770 973 4770 4910 316 2496 4770 3855 973 2508 3855 4834 316 480 316 3581 316 2266 2496 4567 973 2692 4567 2863 2508 2030 3581 1601 973 977 3581 4512 4770 3696 ...
output:
2 5000 3724 1 4189 2 666 3 1134 4 4064 7 1556 7 1918 8 4581 10 3359 10 3922 11 4216 12 3998 12 4780 14 2145 14 3392 14 3471 16 2187 17 110 17 3195 17 4159 17 4381 18 4790 19 3356 19 3711 20 3728 21 1095 22 1824 22 2508 23 70 23 141 23 2507 24 2339 25 2119 25 2257 26 111 27 2002 28 2595 28 4050 29 24...
input:
2 5000 3724 1 4189 2 666 3 1134 4 4064 7 1556 7 1918 8 4581 10 3359 10 3922 11 4216 12 3998 12 4780 14 2145 14 3392 14 3471 16 2187 17 110 17 3195 17 4159 17 4381 18 4790 19 3356 19 3711 20 3728 21 1095 22 1824 22 2508 23 70 23 141 23 2507 24 2339 25 2119 25 2257 26 111 27 2002 28 2595 28 4050 29 24...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 9961656
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 1ms = 1ms + 0ms
memory: 1952kb,33044kb
input:
1 17476204
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 316 4770 973 4770 4910 316 2496 4770 3855 973 2508 3855 4834 316 480 316 3581 316 2266 2496 4567 973 2692 4567 2863 2508 2030 3581 1601 973 977 3581 4512 4770 3696 ...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 316 4770 973 4770 4910 316 2496 4770 3855 973 2508 3855 4834 316 480 316 3581 316 2266 2496 4567 973 2692 4567 2863 2508 2030 3581 1601 973 977 3581 4512 4770 3696 ...
output:
2 5000 3724 1 3505 2 666 3 1134 4 1755 4 4064 7 1556 7 1918 8 4581 10 3359 10 3529 10 3922 11 4216 12 1593 12 3663 12 3998 12 4780 13 3136 14 2145 14 3392 14 3471 16 2187 16 4564 17 110 17 4159 18 4790 19 3356 19 3711 20 3728 21 1095 22 1824 22 2508 23 70 24 2339 25 2119 25 2257 26 111 27 2002 28 13...
input:
2 5000 3724 1 3505 2 666 3 1134 4 1755 4 4064 7 1556 7 1918 8 4581 10 3359 10 3529 10 3922 11 4216 12 1593 12 3663 12 3998 12 4780 13 3136 14 2145 14 3392 14 3471 16 2187 16 4564 17 110 17 4159 18 4790 19 3356 19 3711 20 3728 21 1095 22 1824 22 2508 23 70 24 2339 25 2119 25 2257 26 111 27 2002 28 13...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 9961656
Subtask #3:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 1ms = 1ms + 0ms
memory: 1952kb,33064kb
input:
1 355365355024496523
output:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 316 4770 973 4770 4910 316 2496 4770 3855 973 2508 3855 4834 316 480 316 3581 316 2266 2496 4567 973 2692 4567 2863 2508 2030 3581 1601 973 977 3581 4512 4770 3696 ...
input:
a890c6696058af3ad84e267191c856938f206a8ef7c63581510cdfa15e45f9c07d82b6a58fe3c8183e2b8f4b976dd90fbca50f420ce3dcf29a3d6a73adf47022 1 5000 316 4770 973 4770 4910 316 2496 4770 3855 973 2508 3855 4834 316 480 316 3581 316 2266 2496 4567 973 2692 4567 2863 2508 2030 3581 1601 973 977 3581 4512 4770 3696 ...
output:
2 5000 3724 1 3505 2 666 3 2087 4 1755 4 4064 7 1556 7 1918 8 3532 8 4581 10 2046 10 3529 11 528 12 1593 12 3998 12 4780 13 3136 14 3392 15 3319 16 4564 17 53 17 110 17 3195 17 4381 18 4790 19 557 19 3711 20 2199 21 2148 22 257 22 1907 22 2508 23 70 23 141 24 2339 25 2119 25 2257 26 111 27 2002 28 3...
input:
2 5000 3724 1 3505 2 666 3 2087 4 1755 4 4064 7 1556 7 1918 8 3532 8 4581 10 2046 10 3529 11 528 12 1593 12 3998 12 4780 13 3136 14 3392 15 3319 16 4564 17 53 17 110 17 3195 17 4381 18 4790 19 557 19 3711 20 2199 21 2148 22 257 22 1907 22 2508 23 70 23 141 24 2339 25 2119 25 2257 26 111 27 2002 28 3...
output:
08e2277017156c65e2df558ef1d27eae814767ea6a771d5be687d4040371b97399dd6bd28d5207cce21e4e205ea711c730f7ccf85a21af8c41bab7c037b89e9e 9961656