QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#507836#9156. 百万富翁lin199112281.999975 2388ms102408kbC++141005b2024-08-06 21:35:242024-08-06 21:35:25

Judging History

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

  • [2024-08-06 21:35:25]
  • 评测
  • 测评结果:81.999975
  • 用时:2388ms
  • 内存:102408kb
  • [2024-08-06 21:35:24]
  • 提交

answer

#include<bits/stdc++.h>
#include "richest.h"
using namespace std;
const int N=1e6+3;
bitset<N>vis;
vector<int>work(vector<int>now,int K){
    vector<int>q1,q2,ret;
    int len=now.size();
    for(int i=0;i<len;i+=K)
        for(int j=i;j<min(len,i+K);++j)
            for(int k=j+1;k<min(len,i+K);++k)
                q1.push_back(now[j]),q2.push_back(now[k]);
    vector<int>res=ask(q1,q2);
    int sz=res.size();
    for(int i=0;i<sz;++i)
        if(res[i]==q1[i])vis[q2[i]]=1;
        else vis[q1[i]]=1;
    for(auto x:now)
        if(!vis[x])ret.push_back(x);
    return ret;
}
int richest(int n,int t,int s){
    vis.reset();
    vector<int>now;
    for(int i=0;i<n;++i)now.push_back(i);
    if(t==1){
        now=work(now,n);
        return now[0];
    }
    now=work(now,2);
    now=work(now,2);
    now=work(now,2);
    now=work(now,2);
    now=work(now,3);
    now=work(now,6);
    now=work(now,19);
    now=work(now,183);
    return now[0];
    return 0;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 618ms
memory: 22000kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 67
Acceptable Answer
time: 2361ms
memory: 86708kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960
2586970244946203279
0.788235
12006835993993373281

result:

points 0.788235 Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960


Final Tests

Test #1:

score: 15
Accepted
time: 643ms
memory: 23444kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 67
Acceptable Answer
time: 2388ms
memory: 102408kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960
2586970244946203279
0.788235
12006835993993373281

result:

points 0.788235 Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960