QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#490172#9156. 百万富翁staring#26.00002 2842ms99392kbC++23796b2024-07-25 12:25:372024-07-25 12:25:42

Judging History

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

  • [2024-07-25 12:25:42]
  • 评测
  • 测评结果:26.00002
  • 用时:2842ms
  • 内存:99392kb
  • [2024-07-25 12:25:37]
  • 提交

answer

#include "richest.h"

int richest(int N,int T,int S)
{
    if(N==1000)
    {
        std::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);
        auto c=ask(a,b);

        int res=0;
        for(int i=0,k=0;i<N;i++)
            for(int j=i+1;j<N;j++,k++)
                if((res==a[k]||res==b[k])&&res!=c[k])res=c[k];
        return res;
    }

    std::vector<int> a,b,c;
    for(int i=0;i<N;i++)c.push_back(i);

    while(c.size()>1)
    {
        int back=c.size()&1?c.back():0;
        std::vector<int>().swap(a),std::vector<int>().swap(b);
        for(int i=0;i+1<c.size();i+=2)a.push_back(c[i]),b.push_back(c[i+1]);
        c=ask(a,b);
        if(back)c.push_back(back);
    }

    return c[0];
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 626ms
memory: 25364kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 11
Acceptable Answer
time: 2683ms
memory: 99324kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 11 / 85, maxt = 20, maxs = 999999
1811468636458994965
0.129412
3823502568050958645

result:

points 0.129412 Partially correct Case 2, 11 / 85, maxt = 20, maxs = 999999


Final Tests

Test #1:

score: 15
Accepted
time: 629ms
memory: 25304kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 11
Acceptable Answer
time: 2842ms
memory: 99392kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 11 / 85, maxt = 20, maxs = 999999
1811468636458994965
0.129412
3823502568050958645

result:

points 0.129412 Partially correct Case 2, 11 / 85, maxt = 20, maxs = 999999