QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#741402#9156. 百万富翁Skadi_H0 185ms105720kbC++141.0kb2024-11-13 14:17:542024-11-13 14:17:55

Judging History

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

  • [2024-11-13 14:17:55]
  • 评测
  • 测评结果:0
  • 用时:185ms
  • 内存:105720kb
  • [2024-11-13 14:17:54]
  • 提交

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){
	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;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]]=0;
		}
		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: 2ms
memory: 10912kb

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: 185ms
memory: 105720kb

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: 8944kb

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: 178ms
memory: 99732kb

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