QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#502342#9156. 百万富翁alexz1205#15 641ms46988kbC++14492b2024-08-03 04:04:372024-08-03 04:04:39

Judging History

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

  • [2024-08-03 04:04:39]
  • 评测
  • 测评结果:15
  • 用时:641ms
  • 内存:46988kb
  • [2024-08-03 04:04:37]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"
using namespace std;

int richest(int N, int T, int S){
	if (T == 1){
		vector<int> a, b;
		for (int x = 0; x < N; x ++){
			for (int y = x+1; y < N; y ++){
				a.push_back(x);
				b.push_back(y);
			}
		}
		vector<int> c = ask(a, b);
		int ma = 0;
		int check = 0, cur = 0;
		for (int x = 1; x < N; x ++){
			cur += N-x;
			if (c[check + x-ma-1] == x){
				ma = x;
				check = cur;
			}
		}
		return ma;
	}
	return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 641ms
memory: 25308kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

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

input:

1000000 20 2000000 29091473

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer


Final Tests

Test #1:

score: 15
Accepted
time: 630ms
memory: 25208kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Wrong Answer
time: 12ms
memory: 46988kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer