QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#492380#9156. 百万富翁LinkWish#15 627ms25432kbC++14989b2024-07-26 11:45:472024-07-26 11:45:55

Judging History

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

  • [2024-07-26 11:45:55]
  • 评测
  • 测评结果:15
  • 用时:627ms
  • 内存:25432kb
  • [2024-07-26 11:45:47]
  • 提交

answer

//Linkwish's code
#include<bits/stdc++.h>
#include "richest.h"
#define endl '\n'
#define si static inline
#define mp make_pair
#define fi first
#define se second
using namespace std;typedef long long ll;typedef __int128 li;
typedef pair<int,int> pii;typedef pair<ll,ll> pll;typedef const int ci;
typedef const ll cl;const int iinf=INT_MAX;const ll linf=LLONG_MAX;
template<typename T>si bool gmax(T &x,const T y){if(x<y)return x=y,1;return 0;}
template<typename T>si bool gmin(T &x,const T y){if(y<x)return x=y,1;return 0;}

int n;

namespace S1{
	ci N=1005;
	int tot[N];
	si int solve(){
		memset(tot,0,sizeof tot);
		vector<int> a,b;
		for(int i=0;i<n;i++)
			for(int j=i+1;j<n;j++)
				a.push_back(i),b.push_back(j);
		vector<int> res=ask(a,b);
		for(int i=0;i<(int)res.size();i++)tot[res[i]]++;
		for(int i=0;i<n;i++)if(tot[i]==n-1)return i;
		return -1;
	}
}
int richest(int N, int T, int S) {
	n=N;
	if(N<=1000)return S1::solve();
    return 1;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 627ms
memory: 25432kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Wrong Answer
time: 18ms
memory: 23432kb

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: 616ms
memory: 25272kb

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: 23480kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer