QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#560915#9156. 百万富翁RDFZchenyy15 649ms48636kbC++14884b2024-09-12 18:52:292024-09-12 18:52:30

Judging History

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

  • [2024-09-12 18:52:30]
  • 评测
  • 测评结果:15
  • 用时:649ms
  • 内存:48636kb
  • [2024-09-12 18:52:29]
  • 提交

answer

#include "richest.h"
#include<bits/stdc++.h>

// std::vector<int> ask(std::vector<int> a,std::vector<int> b);

std::vector<int> p,q;
int a[1005][1005];
int richest(int n,int t,int s){
    if(n==1000){
        p.clear(); q.clear();
        memset(a,0,sizeof(a));
        for(int i=0;i<=n-1;i++){
            for(int j=i+1;j<=n-1;j++){
                p.push_back(i); q.push_back(j);
            }
        }
        p=ask(p,q);
        int cnt=0;
        for(int i=0;i<=n-1;i++){
            for(int j=i+1;j<=n-1;j++){
                a[p[cnt]][i+j-p[cnt]]=1;
                cnt++;
            }
        }
        for(int i=0;i<=n-1;i++){
            int cnt=0;
            for(int j=0;j<=n-1;j++){
                cnt+=a[i][j];
            }
            if(cnt==n-1){
                return i;
            }
        }        
    }

    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 649ms
memory: 27984kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Wrong Answer
time: 12ms
memory: 48224kb

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: 637ms
memory: 26252kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Wrong Answer
time: 12ms
memory: 48636kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer