QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#489961#9156. 百万富翁SimonLJK85 2447ms90332kbC++14709b2024-07-25 09:42:072024-07-25 09:42:07

Judging History

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

  • [2024-07-25 09:42:07]
  • 评测
  • 测评结果:85
  • 用时:2447ms
  • 内存:90332kb
  • [2024-07-25 09:42:07]
  • 提交

answer

#include"richest.h"
#include<bits/stdc++.h>
using namespace std;
const int N=1e6+99;
int grp[10]={0,500000,250000,125000,62500,20833,3472,183,1};
int cnt[N];
int richest(int n,int T,int S){
	vector<int> ans;
	for(int i=0;i<n;i++)
		ans.push_back(i);
    for(int i=1;i<=8;i++){
    	vector<int> a,b,c;
    	for(int j=0;j<ans.size();j++)
			for(int k=j%grp[i];k<j;k+=grp[i])
				 a.push_back(ans[j]),b.push_back(ans[k]);
		c=ask(a,b);
		memset(cnt,0,sizeof(cnt));
		for(int j=0;j<c.size();j++)
			if(c[j]==a[j]) cnt[b[j]]++;
			else cnt[a[j]]++;
		vector<int> nid;
		for(int j=0;j<ans.size();j++)
			if(!cnt[ans[j]])
				nid.push_back(ans[j]);
		swap(nid,ans);
	}
    return ans[0];
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 0
Wrong Answer
time: 2ms
memory: 12516kb

input:

1000 1 499500 957319859

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Pretest #2:

score: 85
Accepted
time: 2398ms
memory: 90320kb

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: 0ms
memory: 14032kb

input:

1000 1 499500 957319857

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Test #2:

score: 85
Accepted
time: 2447ms
memory: 90332kb

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