QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#506784#9156. 百万富翁12345678hzx15 632ms68172kbC++14887b2024-08-05 21:48:442024-08-05 21:48:45

Judging History

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

  • [2024-08-05 21:48:45]
  • 评测
  • 测评结果:15
  • 用时:632ms
  • 内存:68172kb
  • [2024-08-05 21:48:44]
  • 提交

answer

#include<iostream>
#include<cstdio>
#include<cstdlib>
#include<cstring>
#include<algorithm>
#include<cmath>
#include<set>
#include<queue>
#include<stack>
#include<vector>
#include<ctime>
#include<map>
#include<set>
#include<bitset>
#include<list>
#include "richest.h"

using namespace std;

int richest(int N,int T,int S) {
	int cnt=0;
	std::vector<int>t,a,b,Map;
	Map.resize(1000005);
	for(int i=0;i<N;i++) t.push_back(i);
	while(cnt<9) {
		if(N<=1000) break;
		a.clear(),b.clear();
		for(int i=1;i<=N/2;i++) a.push_back(t[i*2-2]),b.push_back(t[i*2-1]);
		int last=t.back();
		t=ask(a,b);
		if(N&1) t.push_back(last);
		N=(N+1)/2,cnt++;
	}
	a.clear(),b.clear();
	for(int i=1;i<=N;i++) for(int j=i+1;j<=N;j++) a.push_back(t[i-1]),b.push_back(t[j-1]);
	std::vector<int>Tt=ask(a,b);
	for(auto i:Tt) Map[i]++;
	for(auto i:t) if(Map[i]==N-1) return i;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 632ms
memory: 27640kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Wrong Answer
time: 114ms
memory: 68168kb

input:

1000000 20 2000000 29091473

output:

Too many total elements in queries
1469670942222006797
0.000000
6906350380861515327

result:

points 0.0 Too many total elements in queries


Final Tests

Test #1:

score: 15
Accepted
time: 614ms
memory: 27724kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Wrong Answer
time: 105ms
memory: 68172kb

input:

1000000 20 2000000 29091471

output:

Too many total elements in queries
1469670942222006797
0.000000
6906350380861515327

result:

points 0.0 Too many total elements in queries