QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#509992#9156. 百万富翁AdamGS#84.999965 2212ms86732kbC++231.2kb2024-08-08 20:23:032024-08-08 20:23:04

Judging History

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

  • [2024-08-08 20:23:04]
  • 评测
  • 测评结果:84.999965
  • 用时:2212ms
  • 内存:86732kb
  • [2024-08-08 20:23:03]
  • 提交

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()
const int INF=1e9+7;
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<pair<int,int>>pyt={{2, INF}, {2, INF}, {2, INF}, {2, INF}, {3, INF}, {6, INF}, {18, 4}, {183, 1}};
	vector<int>T(n);
	rep(i, n) T[i]=i;
	for(auto i : pyt) {
		vector<int>A, B;
		int akt=0;
		for(int j=0; j<T.size(); j+=i.st) {
			++akt;
			if(akt==i.nd+1) ++i.st;
			int l=min((int)T.size(), j+i.st)-j;
			rep(a, l) rep(b, a) {
				A.pb(T[j+a]);
				B.pb(T[j+b]);
			}
		}
		if(akt>i.nd) --i.st;
		akt=0;
		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.st) {
			++akt;
			if(akt==i.nd+1) ++i.st;
			int l=min((int)T.size(), j+i.st)-j;
			rep(a, l) if(ile[T[j+a]]==l-1) D.pb(T[j+a]);
		}
		T=D;
	}
	return T[0];
}

詳細信息


Pretests

Pretest #1:

score: 15
Accepted
time: 602ms
memory: 22980kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 70
Acceptable Answer
time: 2212ms
memory: 86584kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 70 / 85, maxt = 8, maxs = 1099954
16413608613130175849
0.823529
10214290605058019817

result:

points 0.823529 Partially correct Case 2, 70 / 85, maxt = 8, maxs = 1099954


Final Tests

Test #1:

score: 15
Accepted
time: 601ms
memory: 22168kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 70
Acceptable Answer
time: 2159ms
memory: 86732kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 70 / 85, maxt = 8, maxs = 1099954
16413608613130175849
0.823529
10214290605058019817

result:

points 0.823529 Partially correct Case 2, 70 / 85, maxt = 8, maxs = 1099954