QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#496924#9156. 百万富翁LiWenX#88.00004 4554ms108956kbC++141.6kb2024-07-28 16:59:432024-07-28 16:59:43

Judging History

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

  • [2024-07-28 16:59:43]
  • 评测
  • 测评结果:88.00004
  • 用时:4554ms
  • 内存:108956kb
  • [2024-07-28 16:59:43]
  • 提交

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]; 
bool vis[1000005];
int richest(int n,int t,int s){
	mt19937 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);
		vector<int> v1,v2;
		vector<vector<int> > vv;
		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((ti==5||ti==6||ti==4)&&i+Lis[ti]>vec.size()){
				for(int j=0;j<num.size();j++){
					vv[j].push_back(num[j]);
				}
				break;
			}
			vv.push_back(num);
		}
		for(auto num:vv){
			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
*/

详细


Pretests

Pretest #1:

score: 15
Accepted
time: 626ms
memory: 31072kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 73
Acceptable Answer
time: 4554ms
memory: 108956kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 73 / 85, maxt = 8, maxs = 1099950
12601388558150859031
0.858824
2728835475266523013

result:

points 0.858824 Partially correct Case 2, 73 / 85, maxt = 8, maxs = 1099950


Final Tests

Test #1:

score: 15
Accepted
time: 623ms
memory: 30468kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 73
Acceptable Answer
time: 4551ms
memory: 108812kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 73 / 85, maxt = 8, maxs = 1099950
12601388558150859031
0.858824
2728835475266523013

result:

points 0.858824 Partially correct Case 2, 73 / 85, maxt = 8, maxs = 1099950