QOJ.ac

QOJ

ID题目提交者结果用时内存语言文件大小提交时间测评时间
#488193#9156. 百万富翁huangzirui15 675ms25944kbC++14948b2024-07-23 17:55:042024-07-23 17:55:04

Judging History

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

  • [2024-07-23 17:55:04]
  • 评测
  • 测评结果:15
  • 用时:675ms
  • 内存:25944kb
  • [2024-07-23 17:55:04]
  • 提交

answer

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

namespace sub1{
    const int maxn=1010;
    int n=1000;
    vector<int>A,B;
    int is[maxn][maxn];
    int solve(int N){
        n=N;
        A.clear();B.clear();
        for(int i=0;i<n;i++)
            for(int j=i+1;j<n;j++){
                A.push_back(i);
                B.push_back(j);
                // cerr<<i<<' '<<j<<"|"<<n<<endl;
            }
        auto C=ask(A,B);int cnt=0;
        for(int i=0;i<n;i++)
            for(int j=i+1;j<n;j++){
                is[i][j]=(C[cnt++]==i);
                is[j][i]=1-is[i][j];
            }
        for(int i=0;i<n;i++){
            bool flg=true;
            for(int j=0;j<n;j++)
                if(i!=j && !is[i][j])flg=false;
            if(flg)return i;
        }
        assert(0);
    }
}

int richest(int N, int T, int S) {
    if(N<=1000)return sub1::solve(N);
    return 1;
}

詳細信息


Pretests

Pretest #1:

score: 15
Accepted
time: 675ms
memory: 25944kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

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

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: 641ms
memory: 24772kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Wrong Answer
time: 13ms
memory: 23996kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer