QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#740582#9156. 百万富翁robertfan15 647ms30872kbC++14672b2024-11-13 10:37:022024-11-13 10:37:02

Judging History

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

  • [2024-11-13 10:37:02]
  • 评测
  • 测评结果:15
  • 用时:647ms
  • 内存:30872kb
  • [2024-11-13 10:37:02]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"
using namespace std;
int mp[8]={1,183,3472,20832,62500,125000,250000,500000};
int ok[1000006];
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.push_back(i);
                b.push_back(j);
            }
        }
        memset(ok,0,sizeof(ok));
        vector<int>c=ask(a,b);
        for(int i=0;i<c.size();i++){
            ok[c[i]]++;
        }
        for(int i=0;i<N;i++){
            if(ok[i]==N-1){
                return i;
            }
        }
    }
    memset(ok,0,sizeof(ok));
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 647ms
memory: 30312kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Runtime Error

input:

1000000 20 2000000 29091473

output:

Unauthorized output

result:



Final Tests

Test #1:

score: 15
Accepted
time: 631ms
memory: 30872kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Runtime Error

input:

1000000 20 2000000 29091471

output:

Unauthorized output

result: