QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#500622#9156. 百万富翁hansiyuan#15 642ms24480kbC++14517b2024-08-01 16:27:252024-08-01 16:27:26

Judging History

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

  • [2024-08-01 16:27:26]
  • 评测
  • 测评结果:15
  • 用时:642ms
  • 内存:24480kb
  • [2024-08-01 16:27:25]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"
using namespace std;
const int N=1e5+5;
vector<int> a,b,c;
bool flag[N];
int richest(int n, int T, int S) {
	memset(flag,0,sizeof(flag));
	a.clear(); b.clear();
	for(int i=1;i<n;i++)
		for(int j=i+1;j<=n;j++)
			a.push_back(i-1), b.push_back(j-1);
	c = ask(a,b);
	int now=0;
	for(int i=1;i<n;i++){
		for(int j=i+1;j<=n;j++){
			if(c[now++]==i-1) flag[j]=1;
			else flag[i]=1;
		}
	}
	for(int i=1;i<=n;i++)
		if(!flag[i]) return i-1;
	return -1;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 624ms
memory: 24480kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Time Limit Exceeded

input:

1000000 20 2000000 29091473

output:

Unauthorized output

result:



Final Tests

Test #1:

score: 15
Accepted
time: 642ms
memory: 22732kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Time Limit Exceeded

input:

1000000 20 2000000 29091471

output:

Unauthorized output

result: