QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#488048 | #9156. 百万富翁 | thangthang | 5.685395 | 4322ms | 112424kb | C++20 | 756b | 2024-07-23 15:37:55 | 2024-07-23 15:37:56 |
Judging History
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