QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#492249 | #9156. 百万富翁 | tuxuanming2024# | 11.00002 | 2675ms | 83632kb | C++14 | 624b | 2024-07-26 10:51:29 | 2024-07-26 10:51:30 |
Judging History
answer
#include "richest.h"
#include <bits/stdc++.h>
using namespace std;
int richest(int n, int T, int S)
{
int tt=0;
vector<int>p;
for(int i=0;i<n;i++) p.push_back(i);
while((int)p.size()>1)
{
int sz=p.size();
vector<int>a,b;
for(int i=0;i<sz;i+=2)
if(i+1<sz) a.push_back(p[i]),b.push_back(p[i+1]);
tt+=a.size();
vector<int>c=ask(a,b),q;
for(int i=0,j=0;i<sz;i+=2)
if(i+1<sz) q.push_back(c[j++]);
else q.push_back(p[i]);
p=q;
// for(auto x:p) cerr<<x<<" ";
// cerr<<'\n';
}
return p[0];
}
/*
g++ grader.cpp richest.cpp -o richest -O2 -std=c++14 -static && ./richest
*/
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 0
Wrong Answer
time: 1ms
memory: 8088kb
input:
1000 1 499500 957319859
output:
Too many queries 1294109832092195181 0.000000 6906350380861515327
result:
points 0.0 Too many queries
Pretest #2:
score: 11
Acceptable Answer
time: 2571ms
memory: 83632kb
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: 0
Wrong Answer
time: 0ms
memory: 8056kb
input:
1000 1 499500 957319857
output:
Too many queries 1294109832092195181 0.000000 6906350380861515327
result:
points 0.0 Too many queries
Test #2:
score: 11
Acceptable Answer
time: 2675ms
memory: 83628kb
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