QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#509843#9156. 百万富翁AdamGS#81.999975 2165ms88136kbC++231.0kb2024-08-08 19:09:372024-08-08 19:09:38

Judging History

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

  • [2024-08-08 19:09:38]
  • 评测
  • 测评结果:81.999975
  • 用时:2165ms
  • 内存:88136kb
  • [2024-08-08 19:09:37]
  • 提交

answer

#include "richest.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
int solve1(int n) {
	vector<int>A, B;
	rep(i, n) rep(j, i) {
		A.pb(j); B.pb(i);
	}
	vector<int>C=ask(A, B);
	vector<int>ile(n);
	for(auto i : C) ++ile[i];
	int ans=-1;
	rep(i, n) if(ile[i]==n-1) ans=i;
	return ans;
}
int richest(int n, int t, int s) {
	if(t==1) return solve1(n);
	vector<int>pyt={2, 2, 2, 2, 3, 6, 19, 183};
	vector<int>T(n);
	rep(i, n) T[i]=i;
	for(auto i : pyt) {
		vector<int>A, B;
		for(int j=0; j<T.size(); j+=i) {
			int l=min((int)T.size(), j+i)-j;
			rep(a, l) rep(b, a) {
				A.pb(T[j+a]);
				B.pb(T[j+b]);
			}
		}
		vector<int>C=ask(A, B);
		vector<int>ile(n);
		for(auto j : C) ++ile[j];
		vector<int>D;
		for(int j=0; j<T.size(); j+=i) {
			int l=min((int)T.size(), j+i)-j;
			rep(a, l) if(ile[T[j+a]]==l-1) D.pb(T[j+a]);
		}
		T=D;
	}
	return T[0];
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 612ms
memory: 22892kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 67
Acceptable Answer
time: 2141ms
memory: 86684kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960
2586970244946203279
0.788235
12006835993993373281

result:

points 0.788235 Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960


Final Tests

Test #1:

score: 15
Accepted
time: 610ms
memory: 22348kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 67
Acceptable Answer
time: 2165ms
memory: 88136kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960
2586970244946203279
0.788235
12006835993993373281

result:

points 0.788235 Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960