QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#499217 | #9156. 百万富翁 | tanxi# | 26.00002 | 2446ms | 99332kb | C++14 | 1.0kb | 2024-07-31 09:10:21 | 2024-07-31 09:10:21 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
std::vector<int> ask(std::vector<int> a, std::vector<int> b);
int richest(int N, int T, int S)
{
vector<int>now,v;
now.clear();v.clear();
v.resize(N+1,0);
for(int i=1;i<=N;i++)
now.push_back(i);
for(int p=1;p<T;p++)
{
vector<int>a,b;
a.clear(),b.clear();
int t=0;
for(auto u:now)
{
if(t)
b.push_back(u-1);
else
a.push_back(u-1);
t^=1;
}
a.resize(min(a.size(),b.size()));
b.resize(min(a.size(),b.size()));
vector<int>c=ask(a,b);
for(int i=0;i<c.size();i++)
{
v[(a[i]^b[i]^c[i])+1]=1;
}
vector<int>newn;
newn.clear();
for(auto u:now)
if(!v[u])
newn.push_back(u);
now.clear();
swap(now,newn);
}
vector<int>a,b;
a.clear(),b.clear();
for(int i=0;i<now.size();i++)
{
for(int j=i+1;j<now.size();j++)
{
a.push_back(now[i]-1);
b.push_back(now[j]-1);
}
}
vector<int> c=ask(a,b);
for(int i=0;i<c.size();i++)
{
v[(a[i]^b[i]^c[i])+1]=1;
}
for(int i=1;i<=N;i++)
if(!v[i])
{
return i-1;
}
}
詳細信息
Pretests
Pretest #1:
score: 15
Accepted
time: 617ms
memory: 25404kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 11
Acceptable Answer
time: 2446ms
memory: 99324kb
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: 15
Accepted
time: 621ms
memory: 23212kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 11
Acceptable Answer
time: 2433ms
memory: 99332kb
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