QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#499374#9156. 百万富翁sunkaihuan#20.00004 2832ms113580kbC++141015b2024-07-31 13:27:192024-07-31 13:27:20

Judging History

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

  • [2024-07-31 13:27:20]
  • 评测
  • 测评结果:20.00004
  • 用时:2832ms
  • 内存:113580kb
  • [2024-07-31 13:27:19]
  • 提交

answer

#include "richest.h"
#include<bits/stdc++.h>
using namespace std;
int ix[1000005],nw[1000005],cl,cr;
vector<int> qla,qlb,an;bool v[1000005];

int richest(int N, int T, int S) {
	for(int i=0;i<=1000000;i++)v[i]=0;
	cl=N;for(int i=1;i<=N;i++)ix[i]=i-1;
	for(int i=1;i<=T-1;i++){
		if(cl==1)return ix[cl];
		qla.clear();qlb.clear();
		for(int j=1;j<cl;j++)
			qla.push_back(ix[j]),qlb.push_back(ix[j+1]);
		an=ask(qla,qlb);cr=0;
		for(int j=1;j<=cl;j++){
			if(j==1&&an[0]==ix[1]||j==cl&&an[cl-2]==ix[cl])nw[++cr]=ix[j];
			if(1<j&&j<cl&&an[j-2]==ix[j]&&an[j-1]==ix[j])nw[++cr]=ix[j];
		}for(int j=1;j<=cr;j++)ix[j]=nw[j];cl=cr;
		//for(int j=1;j<=cl;j++)cout<<ix[j]<<" ";cout<<"\n";
	}if(cl==1)return ix[cl];
	qla.clear();qlb.clear();
	for(int i=1;i<=cl;i++)
		for(int j=i+1;j<=cl;j++)
			qla.push_back(ix[i]),qlb.push_back(ix[j]);
	an=ask(qla,qlb);cr=0;
	for(int i=1;i<=cl;i++)
		for(int j=i+1;j<=cl;j++)
			v[ix[i]+ix[j]-an[cr++]]=1;
	for(int i=1;i<=cl;i++)if(!v[ix[i]])return ix[i];
}

详细


Pretests

Pretest #1:

score: 15
Accepted
time: 617ms
memory: 30504kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 5.00004
Acceptable Answer
time: 2813ms
memory: 113408kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 5 / 85, maxt = 14, maxs = 1654216
7967840838314966391
0.058824
12355811704910996341

result:

points 0.058824 Partially correct Case 2, 5 / 85, maxt = 14, maxs = 1654216


Final Tests

Test #1:

score: 15
Accepted
time: 607ms
memory: 28860kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 5.00004
Acceptable Answer
time: 2832ms
memory: 113580kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 5 / 85, maxt = 14, maxs = 1654334
4994909685917815737
0.058824
12355811704910996341

result:

points 0.058824 Partially correct Case 2, 5 / 85, maxt = 14, maxs = 1654334