QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#496870#9156. 百万富翁LiWenX#Compile Error//C++141.6kb2024-07-28 16:39:132024-07-28 16:39:13

Judging History

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

  • [2024-07-28 16:39:13]
  • 评测
  • [2024-07-28 16:39:13]
  • 提交

answer

#include"richest.h"
#include<bits/stdc++.h>
using namespace std;
int tii[1005][1005];
int tree[1000005<<2],dep[1000005<<2];
int a[1000005];
vector<int> vec;
bool del[1000005]; 
int richest(int n,int t,int s){
	mt19937 rd(rd(time(NULL)));
	if(n==1000){
		vector<int> v1,v2;
		for(int i=0;i<n;i++){
			for(int j=0;j<i;j++){
				v1.push_back(i);
				v2.push_back(j);
			}
		}
		vector<int> ret=ask(v1,v2);
		for(int i=0;i<v1.size();i++){
			tii[v1[i]][v2[i]]=tii[v2[i]][v1[i]]=ret[i];
		}
		for(int i=0;i<n;i++){
			int num=0; 
			for(int j=0;j<n;j++){
				num+=(tii[i][j]==i);
			}
			if(num==n-1) return i;
		}
	}
	for(int i=0;i<n;i++) vec.push_back(i),del[i]=0;
	vector<int> Lis={2,2,2,2,3,6,19,183};
	for(int ti=0;ti<8;ti++){
		shuffle(vec.begin(),vec.end(),rd);
//		cerr<<ti<<" "<<vec.size()<<'\n';
		vector<int> v1,v2;
		for(int i=0;i<vec.size();i+=Lis[ti]){
			vector<int> num;
			for(int j=i;j<vec.size()&&j<i+Lis[ti];j++){
				num.push_back(vec[j]);
			}
			if(vec.size()==183){
//				cerr<<num.back()<<' ';
				del[num.back()]=1;
				num.pop_back();
//				cerr<<num.size()<<' ';
			}
			for(int i=0;i<num.size();i++){
				for(int j=0;j<i;j++){
					v1.push_back(num[i]);
					v2.push_back(num[j]);
				}
			}
		}
		vector<int> ret=ask(v1,v2);
		for(int i=0;i<ret.size();i++){
			if(v1[i]==ret[i]){
				del[v2[i]]=1;
			}
			else del[v1[i]]=1;
		}
		vec.clear();
		for(int i=0;i<n;i++){
			if(!del[i]) vec.push_back(i);
		}
	}
	return vec[0];
}
/*
g++ grader.cpp richest.cpp -o richest.exe -O2 -std=c++14 -static
richest.exe
*/

詳細信息

answer.code: In function ‘int richest(int, int, int)’:
answer.code:10:22: error: no match for call to ‘(std::mt19937 {aka std::mersenne_twister_engine<long unsigned int, 32, 624, 397, 31, 2567483615, 11, 4294967295, 7, 2636928640, 15, 4022730752, 18, 1812433253>}) (time_t)’
   10 |         mt19937 rd(rd(time(NULL)));
      |                    ~~^~~~~~~~~~~~
In file included from /usr/include/c++/13/random:51,
                 from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:179,
                 from answer.code:2:
/usr/include/c++/13/bits/random.h:587:7: note: candidate: ‘std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::result_type std::mersenne_twister_engine<_UIntType, __w, __n, __m, __r, __a, __u, __d, __s, __b, __t, __c, __l, __f>::operator()() [with _UIntType = long unsigned int; long unsigned int __w = 32; long unsigned int __n = 624; long unsigned int __m = 397; long unsigned int __r = 31; _UIntType __a = 2567483615; long unsigned int __u = 11; _UIntType __d = 4294967295; long unsigned int __s = 7; _UIntType __b = 2636928640; long unsigned int __t = 15; _UIntType __c = 4022730752; long unsigned int __l = 18; _UIntType __f = 1812433253; result_type = long unsigned int]’
  587 |       operator()();
      |       ^~~~~~~~
/usr/include/c++/13/bits/random.h:587:7: note:   candidate expects 0 arguments, 1 provided