QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#741511#9156. 百万富翁Skadi_H85 2126ms104280kbC++141.3kb2024-11-13 14:31:102024-11-13 14:31:21

Judging History

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

  • [2024-11-13 14:31:21]
  • 评测
  • 测评结果:85
  • 用时:2126ms
  • 内存:104280kb
  • [2024-11-13 14:31:10]
  • 提交

answer

#include "richest.h"
#include <bits/stdc++.h>
using namespace std;
int len[8]={500000,250000,125000,62500,20833,3472,183,1};
bool vis[1000005];
vector<int>lft,a,b,res,lin;
int richest(int N,int T,int S){
	if(T==1){
		for(int i=0;i<N;i++){
			for(int j=0;j<i;j++){
				a.push_back(i);
				b.push_back(j);
			}
		}
		return a.size();
		res=ask(a,b);
		for(int i=0;i<a.size();i++){
			if(res[i]==a[i])
				vis[b[i]]=1;
			else
				vis[a[i]]=1;
		}
		for(int i=0;i<N;i++){
			if(!vis[i])
				return i;
		}
	}
	lft.resize(N);
	for(int i=0;i<=N;i++){
		lft[i]=i;
	}
	for(int o=0;o<8;o++){
		vector<int>().swap(a);
		vector<int>().swap(b);
		int q=N/len[o],r=N%len[o];
		int pos=0;
		for(int i=1;i<=len[o]-r;i++,pos+=q){
			for(int j=pos;j<pos+q;j++){
				for(int k=pos;k<j;k++){
					a.push_back(lft[j]);
					b.push_back(lft[k]);
				} 
			}
		}
		for(int i=1;i<=r;i++,pos+=q+1){
			for(int j=pos;j<pos+q+1;j++){
				for(int k=pos;k<j;k++){
					a.push_back(lft[j]);
					b.push_back(lft[k]);
				}
			}
		}
		res=ask(a,b);
		for(int i=0;i<a.size();i++){
			if(res[i]==a[i])
				vis[b[i]]=1;
			else
				vis[a[i]]=1;
		}
		for(int x:lft){
			if(!vis[x])
				lin.push_back(x);
		}
		lft=lin;
		vector<int>().swap(lin);
		N=lft.size();
		memset(vis,0,sizeof vis);
	}
	return lft[0];
}
//Skadi_H

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 0
Wrong Answer
time: 5ms
memory: 11408kb

input:

1000 1 499500 957319859

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer

Pretest #2:

score: 85
Accepted
time: 2081ms
memory: 104280kb

input:

1000000 20 2000000 29091473

output:

Correct Case 2, 85 / 85, maxt = 8, maxs = 1099944
7610580723948932399
1.000000
1331569654267968081

result:

points 1.0 Correct Case 2, 85 / 85, maxt = 8, maxs = 1099944


Final Tests

Test #1:

score: 0
Wrong Answer
time: 5ms
memory: 11492kb

input:

1000 1 499500 957319857

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer

Test #2:

score: 85
Accepted
time: 2126ms
memory: 83280kb

input:

1000000 20 2000000 29091471

output:

Correct Case 2, 85 / 85, maxt = 8, maxs = 1099944
7610580723948932399
1.000000
1331569654267968081

result:

points 1.0 Correct Case 2, 85 / 85, maxt = 8, maxs = 1099944