QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#492220#9156. 百万富翁dyj133446#68.99999 2238ms86704kbC++141.4kb2024-07-26 10:33:342024-07-26 10:33:36

Judging History

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

  • [2024-07-26 10:33:36]
  • 评测
  • 测评结果:68.99999
  • 用时:2238ms
  • 内存:86704kb
  • [2024-07-26 10:33:34]
  • 提交

answer

#include<bits/stdc++.h>
using namespace std;
#include "richest.h"
bool vis[1000005];
int richest(int N, int T, int S) {
	if(N<=1000)
	{
		memset(vis,0,sizeof(vis));
		vector<int>a,b,c;
		for(int i=0;i<N;i++)
		{
			for(int j=i+1;j<N;j++)a.emplace_back(i),b.emplace_back(j);
		}
		c=ask(a,b);
		int tot=0;
		for(int i=0;i<N;i++)
		{
			for(int j=i+1;j<N;j++)
			{
				if(c[tot]==i)vis[j]=1;
				else vis[i]=1;
				tot++;
			}
		}
		for(int i=0;i<N;i++)if(!vis[i])return i;
	}
	memset(vis,0,sizeof(vis));
	for(int t=1;;t++)
	{
		vector<int>v,a,b,c;
		for(int i=0;i<N;i++)if(!vis[i])v.emplace_back(i);
		if(v.size()==1)return v[0];
		if(t<=3)for(int i=0;i<v.size();i+=2)
		{
			if(v.size()-i==1)continue;
			a.emplace_back(v[i]),b.emplace_back(v[i+1]);
		}
		else if(t<=8)for(int i=0;i<v.size();i+=3)
		{
			if(v.size()-i==1)continue;
			if(v.size()-i==2)
			{
				a.emplace_back(v[i]),b.emplace_back(v[i+1]);
				continue;
			}
			a.emplace_back(v[i]),b.emplace_back(v[i+1]);
			a.emplace_back(v[i]),b.emplace_back(v[i+2]);
			a.emplace_back(v[i+1]),b.emplace_back(v[i+2]);
		}
		else for(int i=0;i<v.size();i+=128)
		{
			for(int j=0;j<=min((int)v.size()-i-1,127);j++)
			{
				for(int k=j+1;k<=min((int)v.size()-i-1,127);k++)a.emplace_back(v[i+j]),b.emplace_back(v[i+k]);
			}
		}
		c=ask(a,b);
		for(int i=0;i<c.size();i++)
		{
			if(c[i]==a[i])vis[b[i]]=1;
			else vis[a[i]]=1;
		}
	}
}

详细


Pretests

Pretest #1:

score: 15
Accepted
time: 615ms
memory: 27460kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 54
Acceptable Answer
time: 2180ms
memory: 86700kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1094251
16697940838183376241
0.635294
4439523384460221017

result:

points 0.635294 Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1094251


Final Tests

Test #1:

score: 15
Accepted
time: 624ms
memory: 26164kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 54
Acceptable Answer
time: 2238ms
memory: 86704kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1094251
16697940838183376241
0.635294
4439523384460221017

result:

points 0.635294 Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1094251