QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#502241#9156. 百万富翁maxrgby#26.00002 2487ms83620kbC++14816b2024-08-03 01:40:462024-08-03 01:40:47

Judging History

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

  • [2024-08-03 01:40:47]
  • 评测
  • 测评结果:26.00002
  • 用时:2487ms
  • 内存:83620kb
  • [2024-08-03 01:40:46]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"
using namespace std;

int richest(int n, int t, int s) {
	if(t == 1){
		vector<int> a,b,c;
		set<int> nums;
		for(int i = 0;i < n;i++){
			for(int j = i+1;j < n;j++){
				a.push_back(i);
				b.push_back(j);
			}
			nums.insert(i);
		}
		c = ask(a,b);
		for(int i = 0;i < c.size();i++){
			if(c[i] != a[i]){
				nums.erase(a[i]);
			}else{
				nums.erase(b[i]);
			}
		}
		assert(nums.size() == 1);
		return *nums.begin();
	}
	vector<int> nums;
	for(int i = 0;i < n;i++){
		nums.push_back(i);
	}
	while(t--){
		vector<int> arr[2];
		for(int i = 0;i < nums.size();i++){
			arr[i&1].push_back(nums[i]);
		}
		if(arr[0].size() != arr[1].size()){
			arr[1].push_back(nums[0]);
		}
		nums = ask(arr[0],arr[1]);
	}
    return nums[0];
}

详细


Pretests

Pretest #1:

score: 15
Accepted
time: 634ms
memory: 23904kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 11
Acceptable Answer
time: 2487ms
memory: 83620kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 11 / 85, maxt = 20, maxs = 1000007
2862133516934917577
0.129412
3823502568050958645

result:

points 0.129412 Partially correct Case 2, 11 / 85, maxt = 20, maxs = 1000007


Final Tests

Test #1:

score: 15
Accepted
time: 638ms
memory: 21948kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 11
Acceptable Answer
time: 2410ms
memory: 83552kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 11 / 85, maxt = 20, maxs = 1000007
2862133516934917577
0.129412
3823502568050958645

result:

points 0.129412 Partially correct Case 2, 11 / 85, maxt = 20, maxs = 1000007