QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#492213 | #9156. 百万富翁 | leihonglongyin# | 26.00002 | 2691ms | 99312kb | C++14 | 616b | 2024-07-26 10:30:13 | 2024-07-26 10:30:13 |
Judging History
answer
#include "richest.h"
#include<bits/stdc++.h>
using namespace std;int cnt[1005];
int richest(int N,int T,int S){vector<int>now,a,b;
if(T==1){memset(cnt,0,sizeof(cnt));
for(int i=0;i<N;i++)for(int j=i+1;j<N;j++)a.push_back(i),b.push_back(j);
now=ask(a,b);for(auto i:now)cnt[i]++;
for(int i=0;i<N;i++)if(cnt[i]==N-1)return i;
}
for(int i=0;i<N;i++)now.push_back(i);
while(now.size()>1){a.clear(),b.clear();int lst=0;
for(int i=0;i+1<now.size();i+=2)a.push_back(now[i]),b.push_back(now[i+1]);
if(now.size()&1)lst=now.back();
now=ask(a,b);if(lst)now.push_back(lst);
}return now[0];
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 15
Accepted
time: 620ms
memory: 25268kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 11
Acceptable Answer
time: 2640ms
memory: 99312kb
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: 612ms
memory: 25160kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 11
Acceptable Answer
time: 2691ms
memory: 99252kb
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