QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#492134#9156. 百万富翁wangziji#85 2645ms129072kbC++201.1kb2024-07-26 09:44:062024-07-26 09:44:11

Judging History

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

  • [2024-07-26 09:44:11]
  • 评测
  • 测评结果:85
  • 用时:2645ms
  • 内存:129072kb
  • [2024-07-26 09:44:06]
  • 提交

answer

#include "richest.h"
#include<bits/stdc++.h>
using namespace std;
int a[10]={1000000,500000,250000,125000,62500,20833,3472,183,1};
int col[1000005];
vector<int> v[1000005];
bitset<1000005> ok,vis;
int richest(int N, int T, int qwq) {
	vector<int> S;
	for(int i=1;i<=N;i++) S.push_back(i-1);
	for(int i=1;i<=8;i++)
	{
		int w=a[i-1]/a[i],C1=a[i-1]%a[i],C0=a[i]-C1;
		int nw=0,C=0;
		for(int i=0;i<=N;i++) v[i].clear();
		for(int i=1;i<=C1;i++)
		{
			++C;
			for(int j=0;j<=w;j++)
				v[C].push_back(S[nw++]);
		}
		for(int i=1;i<=C0;i++)
		{
			++C;
			for(int j=1;j<=w;j++)
				v[C].push_back(S[nw++]);
		}
		vector<int> v1,v2;
		set<int> ss;
		vis.reset();
		for(int i=1;i<=C;i++)
		{
			for(auto x:v[i])
			{
				for(auto y:v[i])
				{
					if(x==y) break;
					v1.push_back(x),v2.push_back(y);
					vis[x]=vis[y]=1;
				}
			}
		}
		vector<int> V=ask(v1,v2);
		ok.reset();
		for(int i=0;i<v1.size();i++)
		{
			ok[v1[i]+v2[i]-V[i]]=1;
		}
		S.clear();
		for(int i=0;i<N;i++)
			if(!ok[i]&&vis[i]) S.push_back(i);
//		for(auto t:ss) S.push_back(t);
	}
//	cout << S.size() << "\n";
    return S[0];
}

详细


Pretests

Pretest #1:

score: 0
Wrong Answer
time: 48ms
memory: 45376kb

input:

1000 1 499500 957319859

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Pretest #2:

score: 85
Accepted
time: 2645ms
memory: 114088kb

input:

1000000 20 2000000 29091473

output:

Correct Case 2, 85 / 85, maxt = 8, maxs = 1099944
7610580723948932399
1.000000
1331569654267968081

result:

points 1.0 Correct Case 2, 85 / 85, maxt = 8, maxs = 1099944


Final Tests

Test #1:

score: 0
Wrong Answer
time: 50ms
memory: 43288kb

input:

1000 1 499500 957319857

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Test #2:

score: 85
Accepted
time: 2607ms
memory: 129072kb

input:

1000000 20 2000000 29091471

output:

Correct Case 2, 85 / 85, maxt = 8, maxs = 1099944
7610580723948932399
1.000000
1331569654267968081

result:

points 1.0 Correct Case 2, 85 / 85, maxt = 8, maxs = 1099944