QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#509884 | #9156. 百万富翁 | TlenekWodoru# | 66.999975 | 3013ms | 103304kb | C++14 | 1.9kb | 2024-08-08 19:27:58 | 2024-08-08 19:27:58 |
Judging History
answer
#include <bits/stdc++.h>
#include "richest.h"
using namespace std;
vector<int>Kto1={2,2,2,2,3,6,19,183};
vector<int>Kto2={0,0,0,3,0,0,18,0};
vector<int>Ile= {0,0,0,8,0,0,4,0};
bool CzyJestGit[1000000];
int richest(int n, int T, int S)
{
vector<int>Kand;
for(int i=0;i<n;i++)
{
Kand.push_back(i);
}
for(int I=0;I<8;I++)
{
if(Kand.size()==1){break;}
for(int u : Kand)
{
CzyJestGit[u]=1;
}
vector<vector<int>>U;
for(int i=1;i<=Ile[I];i++)
{
vector<int>Temp;
if(Temp.size()<Kto2[I]){break;}
for(int j=1;j<=Kto2[I];j++)
{
Temp.push_back(Kand.back());
Kand.pop_back();
}
U.push_back(Temp);
}
while(Kand.size()>=Kto1[I])
{
vector<int>Temp;
for(int j=1;j<=Kto1[I];j++)
{
Temp.push_back(Kand.back());
Kand.pop_back();
}
U.push_back(Temp);
}
if(Kand.size()>0)
{
U.push_back(Kand);
Kand.clear();
}
vector<int>A,B;
for(vector<int>Temp : U)
{
for(int a=0;a<Temp.size();a++)
{
for(int b=a+1;b<Temp.size();b++)
{
A.push_back(Temp[a]);
B.push_back(Temp[b]);
}
}
}
vector<int>W=ask(A,B);
for(int i=0;i<A.size();i++)
{
if(W[i]==A[i])
{
CzyJestGit[B[i]]=0;
}
else
{
CzyJestGit[A[i]]=0;
}
}
for(int i=0;i<n;i++)
{
if(CzyJestGit[i])
{
Kand.push_back(i);
}
}
}
return Kand[0];
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 0
Wrong Answer
time: 2ms
memory: 10160kb
input:
1000 1 499500 957319859
output:
Too many queries 1294109832092195181 0.000000 6906350380861515327
result:
points 0.0 Too many queries
Pretest #2:
score: 67
Acceptable Answer
time: 3013ms
memory: 103204kb
input:
1000000 20 2000000 29091473
output:
Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960 2586970244946203279 0.788235 12006835993993373281
result:
points 0.788235 Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960
Final Tests
Test #1:
score: 0
Wrong Answer
time: 2ms
memory: 10204kb
input:
1000 1 499500 957319857
output:
Too many queries 1294109832092195181 0.000000 6906350380861515327
result:
points 0.0 Too many queries
Test #2:
score: 67
Acceptable Answer
time: 3000ms
memory: 103304kb
input:
1000000 20 2000000 29091471
output:
Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960 2586970244946203279 0.788235 12006835993993373281
result:
points 0.788235 Partially correct Case 2, 67 / 85, maxt = 8, maxs = 1099960