QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#823010#9156. 百万富翁DinoHadzicCompile Error//C++141.4kb2024-12-20 18:19:282024-12-20 18:19:29

Judging History

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

  • [2024-12-20 18:19:29]
  • 评测
  • [2024-12-20 18:19:28]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"

#define F first
#define S second
#define all(x) x.begin(), x.end()
#define pb push_back
#define FIO ios_base::sync_with_stdio(false); cin.tie(0); cout.tie(0)

using namespace std;

typedef long long ll;
typedef pair <ll, ll> pii;

const int N = 1e6;

int arr[] = {500000, 250000, 125000, 62500, 20833, 3472, 183, 1};

int richest(int n, int t, int s) {
	vector <int> cur, ncur;
	for (int i = 0; i < N; i++) cur.pb(i);
	for (int i = 0; i < 8; i++) {
		vector <int> v1, v2;
		ncur.clear();
		int x = cur.size(), k = arr[i];
		int y = x%k, z = x/k, uk = 0;
		int si[] = {y, k-y}, co[] = {z+1, z};
		for (int o = 0; o < 2; o++) {
			for (int i = 0; i < si[o]; i++) {
				for (int a = 0; a < co[o]; a++) for (int b = a+1; b < co[o]; b++) {
					if (uk+i*co[o]+b >= n) continue;
					v1.pb(cur[uk+i*co[o]+a]);
					v2.pb(cur[uk+i*co[o]+b]);
				}
			}
			uk += si[o]*co[o];
		}
		vector <int> v = ask(v1, v2);
		int br = 0; uk = 0;
		vector <int> deg(ncur, 0);
		for (int o = 0; o < 2; o++) {
			for (int i = 0; i < si[o]; i++) {
				for (int a = 0; a < co[o]; a++) for (int b = a+1; b < co[o]; b++) {
					if (uk+i*co[o]+b < n) deg[v[br++]]++;
					else deg[uk+i*co[o]+a]++;
				}
				for (int a = 0; a < co[o]; a++) if (deg[uk+i*co[o]+a] == co[o]-1) ncur.pb(uk+i*co[o]+a);
			}
			uk += si[o]*co[o];
		}
		swap(ncur, cur);
	}
	return cur[0];
}

Details

answer.code: In function ‘int richest(int, int, int)’:
answer.code:40:41: error: no matching function for call to ‘std::vector<int>::vector(std::vector<int>&, int)’
   40 |                 vector <int> deg(ncur, 0);
      |                                         ^
In file included from /usr/include/c++/13/vector:66,
                 from /usr/include/c++/13/queue:63,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:157,
                 from answer.code:1:
/usr/include/c++/13/bits/stl_vector.h:656:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, std::__type_identity_t<_Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>; std::__type_identity_t<_Alloc> = std::allocator<int>]’
  656 |       vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
      |       ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:656:70: note:   no known conversion for argument 2 from ‘int’ to ‘std::__type_identity_t<std::allocator<int> >&’ {aka ‘const std::allocator<int>&’}
  656 |       vector(vector&& __rv, const __type_identity_t<allocator_type>& __m)
      |                             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:704:9: note: candidate: ‘template<class _InputIterator, class> std::vector<_Tp, _Alloc>::vector(_InputIterator, _InputIterator, const allocator_type&) [with <template-parameter-2-2> = _InputIterator; _Tp = int; _Alloc = std::allocator<int>]’
  704 |         vector(_InputIterator __first, _InputIterator __last,
      |         ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:704:9: note:   template argument deduction/substitution failed:
answer.code:40:41: note:   deduced conflicting types for parameter ‘_InputIterator’ (‘std::vector<int>’ and ‘int’)
   40 |                 vector <int> deg(ncur, 0);
      |                                         ^
/usr/include/c++/13/bits/stl_vector.h:675:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::initializer_list<_Tp>, const allocator_type&) [with _Tp = int; _Alloc = std::allocator<int>; allocator_type = std::allocator<int>]’
  675 |       vector(initializer_list<value_type> __l,
      |       ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:675:43: note:   no known conversion for argument 1 from ‘std::vector<int>’ to ‘std::initializer_list<int>’
  675 |       vector(initializer_list<value_type> __l,
      |              ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:637:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::false_type) [with _Tp = int; _Alloc = std::allocator<int>; allocator_type = std::allocator<int>; std::false_type = std::integral_constant<bool, false>]’
  637 |       vector(vector&& __rv, const allocator_type& __m, false_type)
      |       ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:637:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/13/bits/stl_vector.h:632:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&, const allocator_type&, std::true_type) [with _Tp = int; _Alloc = std::allocator<int>; allocator_type = std::allocator<int>; std::true_type = std::integral_constant<bool, true>]’
  632 |       vector(vector&& __rv, const allocator_type& __m, true_type) noexcept
      |       ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:632:7: note:   candidate expects 3 arguments, 2 provided
/usr/include/c++/13/bits/stl_vector.h:621:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&, std::__type_identity_t<_Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>; std::__type_identity_t<_Alloc> = std::allocator<int>]’
  621 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |       ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:621:74: note:   no known conversion for argument 2 from ‘int’ to ‘std::__type_identity_t<std::allocator<int> >&’ {aka ‘const std::allocator<int>&’}
  621 |       vector(const vector& __x, const __type_identity_t<allocator_type>& __a)
      |                                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/stl_vector.h:617:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(std::vector<_Tp, _Alloc>&&) [with _Tp = int; _Alloc = std::allocator<int>]’
  617 |       vector(vector&&) noexcept = default;
      |       ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:617:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/13/bits/stl_vector.h:598:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(const std::vector<_Tp, _Alloc>&) [with _Tp = int; _Alloc = std::allocator<int>]’
  598 |       vector(const vector& __x)
      |       ^~~~~~
/usr/include/c++/13/bits/stl_vector.h:598:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/13/bits/stl_vector.h:566:7: note: candidate: ‘std::vector<_Tp, _Alloc>::vector(size_type, const value_type&, const allocator_type&) [with...