QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#492211#9156. 百万富翁zwh2008#15 614ms75716kbC++14828b2024-07-26 10:28:512024-07-26 10:28:53

Judging History

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

  • [2024-07-26 10:28:53]
  • 评测
  • 测评结果:15
  • 用时:614ms
  • 内存:75716kb
  • [2024-07-26 10:28:51]
  • 提交

answer

#include<bits/stdc++.h>
#include "richest.h"
using namespace std;
mt19937 rd(5384);
int richest(int n,int T,int S) {
    if(T==1) {
        vector<int>a,b,ct(n);
        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>c=ask(a,b);
        for(int i:c)ct[i]++;
        for(int i=0;i<n;i++)if(ct[i]==n-1)return i;
    }
    vector<int>a(n);
    iota(a.begin(),a.end(),0);
    while(a.size()>1) {
        shuffle(a.begin(),a.end(),rd);
        vector<int>qa,qb,qc,na,del(a.size());
        for(int i=0;i<a.size()-1;i++)qa.push_back(a[i]),qb.push_back(a[i+1]);
        qc=ask(qa,qb);
        for(int i=0;i<qc.size();i++)if(qc[i]==qa[i])del[i+1]=1;else del[i]=1;
        for(int i=0;i<a.size();i++)if(!del[i])na.push_back(i);
        a=na;
    }
    return a[0];
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 614ms
memory: 22024kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 0
Wrong Answer
time: 255ms
memory: 75716kb

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: 613ms
memory: 23068kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 0
Wrong Answer
time: 250ms
memory: 75644kb

input:

1000000 20 2000000 29091471

output:

Wrong answer
4459638610240858557
0.000000
6906350380861515327

result:

points 0.0 Wrong answer