QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#500599#9156. 百万富翁ophQ85 3330ms106048kbC++14690b2024-08-01 15:59:452024-08-01 15:59:46

Judging History

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

  • [2024-08-01 15:59:46]
  • 评测
  • 测评结果:85
  • 用时:3330ms
  • 内存:106048kb
  • [2024-08-01 15:59:45]
  • 提交

answer

#include"richest.h"
#include<bits/stdc++.h>
using namespace std;
const int D[9]={1000000,500000,250000,125000,62500,20833,3472,183,1};
int t[1000002];
int richest(int n,int T,int S){
	vector<int>v;for(int i=0;i<n;i++)v.push_back(i);
	for(int i=1;i<=8;i++){
		vector<vector<int>>g(D[i]);
		vector<int>a,b,c,nv;
		for(int j=0;j<D[i-1];j++)g[j%D[i]].push_back(v[j]);
		for(int j=0;j<D[i];j++)for(int x=0;x<g[j].size();x++)for(int y=x+1;y<g[j].size();y++)a.push_back(g[j][x]),b.push_back(g[j][y]);
		c=ask(a,b);
		memset(t,0,sizeof(t));
		for(int i:c)++t[i];
		for(int j=0;j<D[i];j++)for(int k:g[j])if(t[k]==g[j].size()-1)nv.push_back(k);
		swap(v,nv);
	}
	return v.back();
}

详细


Pretests

Pretest #1:

score: 0
Wrong Answer
time: 16ms
memory: 43368kb

input:

1000 1 499500 957319859

output:

Too many total elements in queries
1469670942222006797
0.000000
6906350380861515327

result:

points 0.0 Too many total elements in queries

Pretest #2:

score: 85
Accepted
time: 3330ms
memory: 106048kb

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: 16ms
memory: 43428kb

input:

1000 1 499500 957319857

output:

Too many total elements in queries
1469670942222006797
0.000000
6906350380861515327

result:

points 0.0 Too many total elements in queries

Test #2:

score: 85
Accepted
time: 3322ms
memory: 105968kb

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