QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#490179#9156. 百万富翁strcspn53.99999 2838ms89040kbC++14899b2024-07-25 12:32:042024-07-25 12:32:06

Judging History

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

  • [2024-07-25 12:32:06]
  • 评测
  • 测评结果:53.99999
  • 用时:2838ms
  • 内存:89040kb
  • [2024-07-25 12:32:04]
  • 提交

answer

#include <bits/stdc++.h>
//#include <windows.h>
using namespace std;
#include "richest.h"
#define rep(i, a, b) for(int i = a; i <= b; i++)
using vec = vector<int>;
using ll = long long int;
constexpr int maxn = 2e6 + 10;
#define ps push_back
int p[35] = { 500000, 250000, 125000, 62500, 31250, 15625, 5209, 882, 47, 1 }, cnt[maxn];
int richest(int n, int t, int s) {
	vec a; 
	for (int i = 0; i < n; i++) a.push_back(i);
	for (int i = 0; i < min(10, t); i++) {
		vec x, y;
		for (int j = 0; j < a.size(); j++) {
			for (int k = j % p[i]; k < j; k += p[i]) if (j != k) x.ps(a[j]), y.ps(a[k]);
		}
		vec z = ask(x, y), na;
		for (int j = 0; j < z.size(); j++) z[j] == x[j] ? ++cnt[y[j]] : ++cnt[x[j]];
		for (int j = 0; j < a.size(); j++) if (!cnt[a[j]]) na.ps(a[j]);
		for (int j = 0; j < z.size(); j++) z[j] == x[j] ? --cnt[y[j]] : --cnt[x[j]];
		a = na; 
	}
	return a[0];
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 0
Wrong Answer
time: 0ms
memory: 8052kb

input:

1000 1 499500 957319859

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer

Pretest #2:

score: 54
Acceptable Answer
time: 2788ms
memory: 88928kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1021733
7243528335533031159
0.635294
4439523384460221017

result:

points 0.635294 Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1021733


Final Tests

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 8076kb

input:

1000 1 499500 957319857

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer

Test #2:

score: 54
Acceptable Answer
time: 2838ms
memory: 89040kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1021733
7243528335533031159
0.635294
4439523384460221017

result:

points 0.635294 Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1021733