QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#667532#8726. Magic Show_Alexande_Compile Error//C++142.4kb2024-10-22 23:58:112024-10-22 23:58:19

Judging History

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

  • [2024-10-22 23:58:19]
  • 评测
  • [2024-10-22 23:58:11]
  • 提交

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:28:30: error: ambiguating new declaration of ‘std::vector<std::pair<long long int, long long int> > Alice()’
   28 | vector < pair < int, int > > Alice () {
      |                              ^~~~~
In file included from Alice.code:2:
Alice.h:3:33: note: old declaration ‘std::vector<std::pair<int, int> > Alice()’
    3 | std::vector<std::pair<int,int>> Alice();
      |                                 ^~~~~
Alice.code: In function ‘std::vector<std::pair<long long int, long long int> > Alice()’:
Alice.code:37:29: error: no matching function for call to ‘std::vector<long long int>::push_back(<brace-enclosed initializer list>)’
   37 |                 e.push_back ( { rd[i], rd[rnd () % ( i - 1 ) + 1] } );
      |                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/functional:64,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53,
                 from Alice.code:1:
/usr/include/c++/13/bits/stl_vector.h:1278:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]’
 1278 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1278:35: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::vector<long long int>::value_type&’ {aka ‘const long long int&’}
 1278 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:1295:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]’
 1295 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1295:30: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<long long int>::value_type&&’ {aka ‘long long int&&’}
 1295 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Alice.code:43:45: error: no matching function for call to ‘std::vector<long long int>::push_back(<brace-enclosed initializer list>)’
   43 |                                 e.push_back ( { res[pos], rd[i] } );
      |                                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1278:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]’
 1278 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1278:35: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::vector<long long int>::value_type&’ {aka ‘const long long int&’}
 1278 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:1295:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]’
 1295 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1295:30: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<long long int>::value_type&&’ {aka ‘long long int&&’}
 1295 |       push_back(value_type&& __x)
      |                 ~~~~~~~~~~~~~^~~
Alice.code:48:45: error: no matching function for call to ‘std::vector<long long int>::push_back(<brace-enclosed initializer list>)’
   48 |                                 e.push_back ( { res[pos], rd[i] } );
      |                                 ~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1278:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]’
 1278 |       push_back(const value_type& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1278:35: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘const std::vector<long long int>::value_type&’ {aka ‘const long long int&’}
 1278 |       push_back(const value_type& __x)
      |                 ~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:1295:7: note: candidate: ‘void std::vector<_Tp, _Alloc>::push_back(value_type&&) [with _Tp = long long int; _Alloc = std::allocator<long long int>; value_type = long long int]’
 1295 |       push_back(value_type&& __x)
      |       ^~~~~~~~~
/usr/include/c++/13/bits/stl_vector.h:1295:30: note:   no known conversion for argument 1 from ‘<brace-enclosed initializer list>’ to ‘std::vector<long long int>::value_type&&’ {aka ‘long long int&&’}
 1295 |...