QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#492678#9156. 百万富翁posvii15 605ms30028kbC++14601b2024-07-26 15:10:462024-07-26 15:10:46

Judging History

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

  • [2024-07-26 15:10:46]
  • 评测
  • 测评结果:15
  • 用时:605ms
  • 内存:30028kb
  • [2024-07-26 15:10:46]
  • 提交

answer

#include "richest.h"
#include<bits/stdc++.h>
using namespace std;
int _[1005][1005];
int richest(int n,int T,int S) {
    if(T==1) {
        vector<int> A,B;
        for(int i=0;i<n;++i) {
            for(int j=i+1;j<n;++j) {
                A.emplace_back(i),B.emplace_back(j);
            }
        }
        auto C=ask(A,B);
        for(int i=0,k=0;i<n;++i) {
            for(int j=i+1;j<n;++j) {
                _[i][j]=C[k++];
            }
        }
        int mx=0;
        for(int i=1;i<n;++i) {
            if(_[mx][i]==i) mx=i;
        }
        return mx;
    }
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 605ms
memory: 29576kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Time Limit Exceeded

input:

1000000 20 2000000 29091473

output:

Unauthorized output

result:



Final Tests

Test #1:

score: 15
Accepted
time: 604ms
memory: 30028kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Memory Limit Exceeded

input:

1000000 20 2000000 29091471

output:

Unauthorized output

result: