QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#492187 | #9156. 百万富翁 | dyj133446# | 23.99997 | 3961ms | 113992kb | C++14 | 1.1kb | 2024-07-26 10:17:04 | 2024-07-26 10:17:05 |
Judging History
answer
#include<bits/stdc++.h>
using namespace std;
#include "richest.h"
bool vis[1000005];
int richest(int N, int T, int S) {
if(N<=1000)
{
memset(vis,0,sizeof(vis));
vector<int>a,b,c;
for(int i=0;i<N;i++)
{
for(int j=i+1;j<N;j++)a.emplace_back(i),b.emplace_back(j);
}
c=ask(a,b);
int tot=0;
for(int i=0;i<N;i++)
{
for(int j=i+1;j<N;j++)
{
if(c[tot]==i)vis[j]=1;
else vis[i]=1;
tot++;
}
}
for(int i=0;i<N;i++)if(!vis[i])return i;
}
memset(vis,0,sizeof(vis));
for(int t=1;;t++)
{
vector<int>v,a,b,c;
for(int i=0;i<N;i++)if(!vis[i])v.emplace_back(i);
if(v.size()==1)return v[0];
for(int i=0;i<v.size();i+=3)
{
if(v.size()-i==1)continue;
if(v.size()-i==2)
{
a.emplace_back(v[i]),b.emplace_back(v[i+1]);
continue;
}
a.emplace_back(v[i]),b.emplace_back(v[i+1]);
a.emplace_back(v[i]),b.emplace_back(v[i+2]);
a.emplace_back(v[i+1]),b.emplace_back(v[i+2]);
}
c=ask(a,b);
for(int i=0;i<c.size();i++)
{
if(c[i]==a[i])vis[b[i]]=1;
else vis[a[i]]=1;
}
}
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 15
Accepted
time: 624ms
memory: 26288kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 8.99997
Acceptable Answer
time: 3858ms
memory: 113560kb
input:
1000000 20 2000000 29091473
output:
Partially correct Case 2, 9 / 85, maxt = 13, maxs = 1499997 7616820272462450011 0.105882 16926627793318235567
result:
points 0.105882 Partially correct Case 2, 9 / 85, maxt = 13, maxs = 1499997
Final Tests
Test #1:
score: 15
Accepted
time: 617ms
memory: 28056kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 8.99997
Acceptable Answer
time: 3961ms
memory: 113992kb
input:
1000000 20 2000000 29091471
output:
Partially correct Case 2, 9 / 85, maxt = 13, maxs = 1499997 7616820272462450011 0.105882 16926627793318235567
result:
points 0.105882 Partially correct Case 2, 9 / 85, maxt = 13, maxs = 1499997