QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#668376 | #8726. Magic Show | _Alexande_ | 0 | 49ms | 1896kb | C++14 | 2.6kb | 2024-10-23 14:03:54 | 2024-10-23 14:03:54 |
Judging History
Alice
#include <bits/stdc++.h>
#include "Alice.h"
using namespace std;
mt19937 rnd ( 1145141 );
const int N = 5005;
int n;
int rd[N], tmp[N];
vector < pair < int, int > > e;
vector < int > rnd_2 ( int lim ) {
for ( int i = 1; i <= lim; i ++ ) {
tmp[i] = i;
}
for ( int i = 1; i <= lim; i ++ ) {
swap ( tmp[i], tmp[rnd () % lim + 1] );
}
vector < int > res;
for ( int i = 1; i <= 2; i ++ ) {
res.push_back ( tmp[i] );
}
return res;
}
vector < pair < int, int > > Alice () {
long long x = setN ( 4980 );
for ( int i = 1; i <= n; i ++ ) {
rd[i] = i;
}
for ( int i = 1; i <= n; i ++ ) {
swap ( rd[i], rd[rnd () % n + 1] );
}
for ( int i = 2; i <= 100; i ++ ) {
e.push_back ( { rd[i], rd[rnd () % ( i - 1 ) + 1] } );
}
for ( int i = 101, j = 0; i <= 4980, j < 61; i += 80, j ++ ) {
for ( int k = i; k <= i + 80 - 1; k ++ ) {
vector < int > tmp = rnd_2 ( i - 1 );
if ( ( x >> ( long long ) j ) & 1ll ) {
e.push_back ( { rd[k], rd[tmp[0]] } );
}
else {
e.push_back ( { rd[k], rd[tmp[1]] } );
}
}
}
return e;
}
Bob
#include <bits/stdc++.h>
#include "Bob.h"
using namespace std;
mt19937 rnd ( 1145141 );
const int N = 5005;
int n;
int rd[N], tmp[N];
set < pair < int, int > > mp;
vector < int > rnd_2 ( int lim ) {
for ( int i = 1; i <= lim; i ++ ) {
tmp[i] = i;
}
for ( int i = 1; i <= lim; i ++ ) {
swap ( tmp[i], tmp[rnd () % lim + 1] );
}
vector < int > res;
for ( int i = 1; i <= 2; i ++ ) {
res.push_back ( tmp[i] );
}
return res;
}
long long Bob ( vector < pair < int, int > > e ) {
for ( pair < int, int > it : e ) {
mp.insert ( it );
mp.insert ( { it.second, it.first } );
}
for ( int i = 1; i <= n; i ++ ) {
rd[i] = i;
}
for ( int i = 1; i <= n; i ++ ) {
swap ( rd[i], rd[rnd () % n + 1] );
}
for ( int i = 2; i <= 100; i ++ ) {
e.push_back ( { rd[i], rd[rnd () % ( i - 1 ) + 1] } );
}
long long x = 0;
for ( int i = 101, j = 0; i <= 4980, j < 61; i += 80, j ++ ) {
long long val = -1;
for ( int k = i; k <= i + 80 - 1; k ++ ) {
vector < int > tmp = rnd_2 ( i - 1 );
if ( mp.find ( { rd[k], rd[tmp[0]] } ) != mp.end () ) {
val = 1;
break;
}
if ( mp.find ( { rd[k], rd[tmp[0]] } ) != mp.end () ) {
val = 0;
break;
}
}
if ( val ) {
x += ( 1ll << ( long long ) j );
}
}
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: 49ms = 49ms + 0ms
memory: 1892kb,1740kb
input:
1 4005
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
Subtask #2:
score: 0
Wrong Answer
Test #13:
score: 0
Wrong Answer
time: 48ms = 48ms + 0ms
memory: 1896kb,1736kb
input:
1 17476204
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
Subtask #3:
score: 0
Wrong Answer
Test #25:
score: 0
Wrong Answer
time: 48ms = 48ms + 0ms
memory: 1892kb,1740kb
input:
1 355365355024496523
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
input:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.
output:
9ff923928e5675d6f7ae686fcfb20beac84bc7b1a47cf13bde24b59497bcae3b4900097049e1c568aa409defdbadf4cfc599c0e496e22068170cce547295ffa4 Edges returned by Alice() have invalid node.