QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#489949#9156. 百万富翁SimonLJK0 141ms105044kbC++14700b2024-07-25 09:34:262024-07-25 09:34:27

Judging History

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

  • [2024-07-25 09:34:27]
  • 评测
  • 测评结果:0
  • 用时:141ms
  • 内存:105044kb
  • [2024-07-25 09:34:26]
  • 提交

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=1;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(j),b.push_back(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: 12312kb

input:

1000 1 499500 957319859

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Pretest #2:

score: 0
Wrong Answer
time: 141ms
memory: 101600kb

input:

1000000 20 2000000 29091473

output:

Too many total elements in queries
1469670942222006797
0.000000
6906350380861515327

result:

points 0.0 Too many total elements in queries


Final Tests

Test #1:

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

input:

1000 1 499500 957319857

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Test #2:

score: 0
Wrong Answer
time: 134ms
memory: 105044kb

input:

1000000 20 2000000 29091471

output:

Too many total elements in queries
1469670942222006797
0.000000
6906350380861515327

result:

points 0.0 Too many total elements in queries