QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#537613#9156. 百万富翁kimmoqt#15 618ms24072kbC++20881b2024-08-30 16:39:502024-08-30 16:39:51

Judging History

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

  • [2024-08-30 16:39:51]
  • 评测
  • 测评结果:15
  • 用时:618ms
  • 内存:24072kb
  • [2024-08-30 16:39:50]
  • 提交

answer

#include "richest.h"

#include <bits/stdc++.h>
using namespace std;   

int richest(int N, int T, int S) {
        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);

        vector<vector<int>> comp(N,vector<int>(N));

        int cnt=0;
        for(int i=0;i<N;i++) {
                for(int j=i+1;j<N;j++) {
                        comp[i][j]=res[cnt];
                        comp[j][i]=res[cnt];
                        cnt++;
                }
        }

        vector<int> ord;
        for(int i=0;i<N;i++) ord.push_back(i);

        sort(ord.begin(),ord.end(),[&](int i, int j){
                return comp[i][j]==i;
        });

        return ord[0];
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 618ms
memory: 23636kb

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: 615ms
memory: 24072kb

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: