QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#495356#9156. 百万富翁TimDee#77.99996 1974ms86072kbC++172.2kb2024-07-27 20:16:112024-07-27 20:16:11

Judging History

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

  • [2024-07-27 20:16:11]
  • 评测
  • 测评结果:77.99996
  • 用时:1974ms
  • 内存:86072kb
  • [2024-07-27 20:16:11]
  • 提交

answer

#include "richest.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second 
#define all(x) x.begin(), x.end()
int richest(int n, int T, int S) {
    if (T==1) {
        vector<int> f,s;
        forn(i,n) forn(j,i) {f.pb(j); s.pb(i);}
        auto z = ask(f,s);
        vector<pi> cnt(n);
        forn(i,n) cnt[i].s=i;
        for(auto&x:z) cnt[x].f++;
        sort(all(cnt));
        return cnt[n-1].s;
    }
    vector<int> a; forn(i,n) a.pb(i);
    for(int it=0; it<4; ++it) {
        vector<int> f,s;
        for(int i=0; i<a.size(); i+=2) {
            f.pb(a[i]);
            s.pb(a[i+1]);
        }
        auto z = ask(f,s);
        a = z;
    }
    vector<int> cnt(n);
    if (1) {
        vector<int> f,s;
        for(int i=0; i<a.size(); i+=4) {
            for(int x=0; x<4; ++x) {
                for(int y=x+1; y<4; ++y) {
                    f.pb(a[i+x]);
                    s.pb(a[i+y]);
                }
            }
        }
        auto z = ask(f,s);
        for(auto&x:z) cnt[x]++;
        vector<int> b;
        forn(i,n) if (cnt[i]==3) b.pb(i);
        forn(i,n) cnt[i]=0;
        a=b;
    }
    for(int it=0; it<2; ++it) {
        vector<int> f,s;
        for(int i=0; i<a.size(); i+=5) {
            for(int x=0; x<5; ++x) {
                for(int y=x+1; y<5; ++y) {
                    f.pb(a[i+x]);
                    s.pb(a[i+y]);
                }
            }
        }
        auto z = ask(f,s);
        for(auto&x:z) cnt[x]++;
        vector<int> b;
        forn(i,n) if (cnt[i]==4) b.pb(i);
        forn(i,n) cnt[i]=0;
        a=b;
    }
    for(int it=0; it<2; ++it) {
        vector<int> f,s;
        for(int i=0; i<a.size(); i+=25) {
            for(int x=0; x<25; ++x) {
                for(int y=x+1; y<25; ++y) {
                    f.pb(a[i+x]);
                    s.pb(a[i+y]);
                }
            }
        }
        auto z = ask(f,s);
        for(auto&x:z) cnt[x]++;
        vector<int> b;
        forn(i,n) if (cnt[i]==24) b.pb(i);
        forn(i,n) cnt[i]=0;
        a=b;
    }
    return a[0];
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 611ms
memory: 22932kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 63
Acceptable Answer
time: 1974ms
memory: 85936kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 63 / 85, maxt = 9, maxs = 1076550
7004794136573474741
0.741176
16601290867448354019

result:

points 0.741176 Partially correct Case 2, 63 / 85, maxt = 9, maxs = 1076550


Final Tests

Test #1:

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

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 63
Acceptable Answer
time: 1958ms
memory: 86072kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 63 / 85, maxt = 9, maxs = 1076550
7004794136573474741
0.741176
16601290867448354019

result:

points 0.741176 Partially correct Case 2, 63 / 85, maxt = 9, maxs = 1076550