QOJ.ac

QOJ

IDProblemSubmitterResultTimeMemoryLanguageFile sizeSubmit timeJudge time
#488048#9156. 百万富翁thangthang5.685395 4322ms112424kbC++20756b2024-07-23 15:37:552024-07-23 15:37:56

Judging History

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

  • [2024-07-23 15:37:56]
  • 评测
  • 测评结果:5.685395
  • 用时:4322ms
  • 内存:112424kb
  • [2024-07-23 15:37:55]
  • 提交

answer

#include <bits/stdc++.h>
#include "richest.h"

using namespace std;

int richest(int N, int T, int S){
    vector <int> p = {};
    vector <bool> used(N, 0);
    for (int i = 0; i < N; ++ i) p.push_back(i);
    while (p.size() > 1){
        random_shuffle(p.begin(), p.end());
        vector <int> a = {}; for (int i = 0; i < p.size() - 1; ++ i) a.push_back(p[i]);
        vector <int> b = {}; for (int i = 1; i < p.size(); ++ i) b.push_back(p[i]);
        vector <int> ans = ask(a, b);
        for (int i = 0; i < ans.size(); ++ i){
            if (ans[i] == a[i]) used[b[i]] = 1;
            else used[a[i]] = 1;
        }
        p = {};
        for (int i = 0; i < N; ++ i) if (!used[i]) p.push_back(i);
    }
    return p[0];
}

Details

Tip: Click on the bar to expand more detailed information

Pretests

Pretest #1:

score: 0
Wrong Answer
time: 0ms
memory: 8112kb

input:

1000 1 499500 957319859

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Pretest #2:

score: 5.69203
Acceptable Answer
time: 4255ms
memory: 112424kb

input:

1000000 20 2000000 29091473

output:

Partially correct Case 2, 5 / 85, maxt = 14, maxs = 1648924
16383508395827989273
0.066965
14856608634625532895

result:

points 0.066965 Partially correct Case 2, 5 / 85, maxt = 14, maxs = 1648924


Final Tests

Test #1:

score: 0
Wrong Answer
time: 1ms
memory: 8024kb

input:

1000 1 499500 957319857

output:

Too many queries
1294109832092195181
0.000000
6906350380861515327

result:

points 0.0 Too many queries

Test #2:

score: 5.68539
Acceptable Answer
time: 4322ms
memory: 112424kb

input:

1000000 20 2000000 29091471

output:

Partially correct Case 2, 5 / 85, maxt = 14, maxs = 1649372
3284848151828056821
0.066887
14616431421169357253

result:

points 0.066887 Partially correct Case 2, 5 / 85, maxt = 14, maxs = 1649372