QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#668251#8726. Magic Show_Alexande_Compile Error//C++142.4kb2024-10-23 13:06:512024-10-23 13:06:56

Judging History

你现在查看的是最新测评结果

  • [2024-10-23 13:06:56]
  • 评测
  • [2024-10-23 13:06:51]
  • 提交

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 < pair < signed, signed > > 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;
}

std::vector<std::pair<signed,signed> > 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

/usr/bin/ld: /tmp/cc4KV3km.o: in function `main':
grader_Bob.cpp:(.text.startup+0x2d1): undefined reference to `Bob(std::vector<std::pair<int, int>, std::allocator<std::pair<int, int> > >)'
collect2: error: ld returned 1 exit status