QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#509761#9156. 百万富翁ewrilan#39.000005 2122ms85972kbC++202.6kb2024-08-08 18:23:012024-08-08 18:23:02

Judging History

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

  • [2024-08-08 18:23:02]
  • 评测
  • 测评结果:39.000005
  • 用时:2122ms
  • 内存:85972kb
  • [2024-08-08 18:23:01]
  • 提交

answer

//
#ifndef __SIZEOF_INT128__
  #define __SIZEOF_INT128__
#endif
#pragma GCC optimize("Ofast")
#include <bits/stdc++.h>
#include <ext/pb_ds/assoc_container.hpp>
#include <ext/pb_ds/tree_policy.hpp>
using namespace std;
using namespace chrono;
using namespace __gnu_pbds;
template <typename T> using oset =  tree<T, null_type, less_equal<T>, rb_tree_tag, tree_order_statistics_node_update>;
#define rep(i, p, k) for(int i(p); i < (k); ++i)
#define per(i, p, k) for(int i(p); i > (k); --i)
#define sz(x) (int)(x).size()
#define sc static_cast
typedef long long ll;
typedef long double ld;
typedef unsigned int uint;
typedef unsigned long long ull;
typedef __int128_t lll;
//#define int ll
template <typename T = int> using par = std::pair <T, T>;
#define fi first
#define se second
#define test int _number_of_tests(in()); while(_number_of_tests--)
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define pb emplace_back
struct Timer {
    string name{""};
    time_point<high_resolution_clock> end, start{high_resolution_clock::now()};
    duration<float, std::milli> dur;
    Timer() = default;
    Timer(string nm): name(nm) {}
    ~Timer() {
        end = high_resolution_clock::now(); dur= end - start;
        cout << "@" << name << "> " << dur.count() << " ms" << '\n';
    }
};
template <typename T = int> inline T in()
{
    static T x;
    std::cin >> x;
    return x;
}
std::string yn(bool b)
{
    if(b) return "YES\n";
    else return "NO\n";
}
template <typename F, typename S> std::ostream& operator<<(std::ostream& out, const std::pair <F, S>& par);
template <typename T> std::ostream& operator<< (std::ostream& out, const std::vector <T>& wek)
{
    for(const auto& i : wek)out << i << ' ';
    return out;
}
template <typename F, typename S> std::ostream& operator<<(std::ostream& out, const std::pair <F, S>& par)
{
    out << '{'<<par.first<<", "<<par.second<<"}";
    return out;
}
#define show(x) cerr << #x << " = " << x << '\n';
#include "richest.h"
int richest(int n, int t ,int s)
{
    vector <int> v(n);
    iota(all(v), 0);
    rep(powt, 0, 11)if(t > 1 && sz(v) > 1){
        vector <int> a, b;
        for(int i(sz(v) % 2); i < sz(v); i += 2){
            a.pb(v[i]); b.pb(v[i+1]);
        }
        vector <int> o(ask(a, b));
        if(sz(v) % 2)o.pb(v[0]);
        v = o;
        --t;
    }
    if(sz(v) == 1)return v[0];
    vector <int> a, b;
    rep(i, 0, sz(v))rep(j, i+1, sz(v)){
        a.pb(v[i]);
        b.pb(v[j]);
    }
    vector <int> o(ask(a, b));
    vector <int> l(n);
    for(auto i: o)++l[i];
    rep(i, 0, n)if(l[i] == sz(v)-1)return i;
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 15
Accepted
time: 594ms
memory: 21892kb

input:

1000 1 499500 957319859

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Pretest #2:

score: 24
Acceptable Answer
time: 2111ms
memory: 85828kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 24 / 85, maxt = 12, maxs = 1118827
2893638666736527915
0.282353
2192392354278883037

result:

points 0.282353 Partially correct Case 2, 24 / 85, maxt = 12, maxs = 1118827


Final Tests

Test #1:

score: 15
Accepted
time: 592ms
memory: 23092kb

input:

1000 1 499500 957319857

output:

Correct
7127326332295218295
1.000000
1331569654267968081

result:

points 1.0 Correct

Test #2:

score: 24
Acceptable Answer
time: 2122ms
memory: 85972kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 24 / 85, maxt = 12, maxs = 1118827
2893638666736527915
0.282353
2192392354278883037

result:

points 0.282353 Partially correct Case 2, 24 / 85, maxt = 12, maxs = 1118827