QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#537586#9156. 百万富翁Nevll#0 8ms15992kbC++14944b2024-08-30 16:17:202024-08-30 16:17:21

Judging History

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

  • [2024-08-30 16:17:21]
  • 评测
  • 测评结果:0
  • 用时:8ms
  • 内存:15992kb
  • [2024-08-30 16:17:20]
  • 提交

answer

#include "richest.h"
# include <bits/stdc++.h>
# define ll long long
# define fi first
# define se second
# define pii pair<int, int>
using namespace std;

int richest(int N, int T, int S) {
    vector<int> as1, as2;
    vector<int> gt;
    as1.clear();
    as2.clear();
    for(int i=1;i<N;i++) {
        for(int k=i+1;k<=N;k++) {
            as1.push_back(i);
            as2.push_back(k);
        }
    }
    gt = ask(as1, as2);
    vector<vector<bool>> cek(N);
    for(int i=0;i<N;i++) {
        cek[i].resize(N);
        for(int k=0;k<N;k++) cek[i][k] = 0;
    }
    
    int v = 0;
    for(int c=1;c<N;c++) {
        for(int d=c+1;d<=N;d++) {
            if(gt[v] == c) cek[c][d] = 1;
            else cek[d][c] = 1;
        }
    }

    for(int i=1;i<=N;i++) {
        int ct = 0;
        for(int k=1;k<=N;k++) {
            if(cek[i][k]) ct++;
        }
        if(ct == N - 1) return i;
    }
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 0
Wrong Answer
time: 5ms
memory: 15932kb

input:

1000 1 499500 957319859

output:

Index out of bounds
9775460264716263939
0.000000
6906350380861515327

result:

points 0.0 Index out of bounds

Pretest #2:

score: 0
Time Limit Exceeded

input:

1000000 20 2000000 29091473

output:

Unauthorized output

result:



Final Tests

Test #1:

score: 0
Wrong Answer
time: 8ms
memory: 15992kb

input:

1000 1 499500 957319857

output:

Index out of bounds
9775460264716263939
0.000000
6906350380861515327

result:

points 0.0 Index out of bounds

Test #2:

score: 0
Memory Limit Exceeded

input:

1000000 20 2000000 29091471

output:

Unauthorized output

result: