QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#740373#9156. 百万富翁piggy12315 613ms33844kbC++20615b2024-11-13 09:25:292024-11-13 09:25:29

Judging History

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

  • [2024-11-13 09:25:29]
  • 评测
  • 测评结果:15
  • 用时:613ms
  • 内存:33844kb
  • [2024-11-13 09:25:29]
  • 提交

answer

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

ll id[1005][1005];

int richest(int N, int T, int S) {
	if (T==1){
		vector<int> vct1,vct2;
		ll tot=-1;
		for (ll i=0;i<N;i++){
			for (ll j=i+1;j<N;j++){
				vct1.push_back(i);
				vct2.push_back(j);
				id[i][j]=++tot;
			}
		}
		vector<int> p=ask(vct1,vct2);
		for (ll i=0;i<N;i++){
			ll c=0;
			for (ll j=0;j<N;j++){
				if (i!=j){
					if (j<i){
						c+=p[id[j][i]]==i;
					}else{
						c+=p[id[i][j]]==i;
					}
				}
			}
			if (c==N-1){
				return i;
			}
		}
	}
    return 1;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 613ms
memory: 32888kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Wrong Answer
time: 10ms
memory: 24396kb

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: 594ms
memory: 33844kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Wrong Answer
time: 17ms
memory: 23756kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer