QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#667526 | #8726. Magic Show | _Alexande_ | Compile Error | / | / | C++14 | 2.4kb | 2024-10-22 23:56:13 | 2024-10-22 23:56:29 |
Judging History
Alice
#include <bits/stdc++.h>
#include <Alice.h>
#define int long long
using namespace std;
mt19937 rnd ( 1145141 );
const int N = 5005;
int n;
int rd[N], tmp[N];
vector < int > e;
vector < int > rnd_80 ( 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 <= 80; i ++ ) {
res.push_back ( rd[tmp[i]] );
}
return res;
}
vector < pair < int, int > > Alice () {
int 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; j < 61; i += 80, j ++ ) {
vector < int > res = rnd_80 ( i - 1 );
if ( ( x >> j ) & 1 ) {
for ( int pos = 0; pos < 40; pos ++ ) {
e.push_back ( { res[pos], rd[i] } );
}
}
else {
for ( int pos = 40; pos < 80; pos ++ ) {
e.push_back ( { res[pos], rd[i] } );
}
}
}
return e;
}
Bob
#include <bits/stdc++.h>
#include <Bob.h>
#define int long long
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_80 ( 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 <= 80; i ++ ) {
res.push_back ( rd[tmp[i]] );
}
return res;
}
int 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] } );
}
int x = 0;
for ( int i = 101, j = 0; j < 61; i += 80, j ++ ) {
vector < int > res = rnd_80 ( i - 1 );
int val = -1;
for ( int pos = 0; pos < 40; pos ++ ) {
if ( mp.find ( { rd[tmp[pos]], rd[i] } ) != mp.end () ) {
val = 1;
break;
}
}
for ( int pos = 40; pos < 80; pos ++ ) {
if ( mp.find ( { rd[tmp[pos]], rd[i] } ) != mp.end () ) {
val = 0;
break;
}
}
x += val << j;
}
return x;
}
Details
Alice.code:2:10: fatal error: Alice.h: No such file or directory 2 | #include <Alice.h> | ^~~~~~~~~ compilation terminated.