QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#492302#9156. 百万富翁Felix72#66.999975 2127ms117884kbC++141.4kb2024-07-26 11:20:242024-07-26 11:20:26

Judging History

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

  • [2024-07-26 11:20:26]
  • 评测
  • 测评结果:66.999975
  • 用时:2127ms
  • 内存:117884kb
  • [2024-07-26 11:20:24]
  • 提交

answer

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

const int N = 1000010;
int pos[N], cnt, nxt[N], tot, siz[N], fin[N];
int richest(int n, int t, int s)
{
	if(n <= 0)
	{
		vector < int > a, b, c; int cnt[1010] = {0};
		for(int i = 0; i < n; ++i)
			for(int j = i + 1; j < n; ++j)
				a.push_back(i), b.push_back(j);
		c = ask(a, b);
		for(int i = 0; i < (int)c.size(); ++i) ++cnt[c[i]];
		for(int i = 0; i < n; ++i) if(cnt[i] == n - 1) return i;
	}
	else
	{
		int num[10] = {0, 2, 2, 2, 2, 3, 6, 19, 183};
		cnt = n;
		for(int i = 1; i <= cnt; ++i) pos[i] = i - 1;
		for(int i = 1; i <= 8; ++i)
		{
			int B = num[i];
			vector < int > a, b, c;
			for(int j = 0; j <= n; ++j) fin[j] = 0;
			for(int l = 1; l <= cnt; ++l)
			{
				int r = min(l + B - 1, cnt);
//				cerr << "! " << l << " " << r << '\n';
//				for(int j = l; j <= r; ++j) cerr << pos[j] << " "; cerr << '\n';
				for(int j = l; j <= r; ++j) siz[j] = r - l + 1;
				for(int p1 = l; p1 <= r; ++p1)
					for(int p2 = p1 + 1; p2 <= r; ++p2)
						a.push_back(pos[p1]), b.push_back(pos[p2]);
				l = r;
			}
			c = ask(a, b);
			for(int j = 0; j < (int)c.size(); ++j) ++fin[c[j]];
			tot = 0;
			for(int j = 1; j <= cnt; ++j)
			{
				if(fin[pos[j]] == siz[j] - 1)
				{
					nxt[++tot] = pos[j];
				}
			}
			cnt = tot;
			for(int j = 1; j <= cnt; ++j) pos[j] = nxt[j];
		}
		return pos[1];
	}
}
/*
1100043
2 2 2 2 3 6 19 183
*/

详细


Pretests

Pretest #1:

score: 0
Wrong Answer
time: 3ms
memory: 16272kb

input:

1000 1 499500 957319859

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Pretest #2:

score: 67
Acceptable Answer
time: 2079ms
memory: 113604kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960
2586970244946203279
0.788235
12006835993993373281

result:

points 0.788235 Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960


Final Tests

Test #1:

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

input:

1000 1 499500 957319857

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Test #2:

score: 67
Acceptable Answer
time: 2127ms
memory: 117884kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960
2586970244946203279
0.788235
12006835993993373281

result:

points 0.788235 Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960