QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#508872 | #9156. 百万富翁 | Ecrade_ | 67.999965 | 4402ms | 102408kb | C++14 | 951b | 2024-08-07 21:01:00 | 2024-08-07 21:01:00 |
Judging History
answer
#include "richest.h"
#include <bits/stdc++.h>
using namespace std;
void work(int &n,int x,vector <int> &now){
vector <int> a,b,c,tmp;
for (int j = 0;j < n - x + 1;j += x){
for (int k = 0;k < x;k += 1) for (int l = k + 1;l < x;l += 1){
a.emplace_back(now[j + k]);
b.emplace_back(now[j + l]);
}
}
for (int j = n / x * x;j < n;j += 1) tmp.emplace_back(now[j]);
c = ask(a,b);
map <int,int> cnt;
for (int j = 0,qwq = 0;j < n - x + 1;j += x,qwq += x * (x - 1) / 2){
for (int k = 0;k < x * (x - 1) / 2;k += 1) cnt[c[qwq + k]] += 1;
for (int k = 0;k < x;k += 1) if (cnt[now[j + k]] == x - 1){tmp.emplace_back(now[j + k]); break;}
}
swap(tmp,now),n = now.size();
}
int richest(int n,int t,int s){
vector <int> a;
for (int i = 0;i < n;i += 1) a.emplace_back(i);
if (n == 1000) work(n,n,a);
else work(n,2,a),work(n,2,a),work(n,2,a),work(n,2,a),work(n,3,a),work(n,6,a),work(n,19,a),work(n,n,a);
return a[0];
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 15
Accepted
time: 736ms
memory: 23180kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 53
Acceptable Answer
time: 4265ms
memory: 102408kb
input:
1000000 20 2000000 29091473
output:
Partially correct Case 2, 53 / 85, maxt = 8, maxs = 1102704 8188143693296750335 0.623529 10011996817885199269
result:
points 0.623529 Partially correct Case 2, 53 / 85, maxt = 8, maxs = 1102704
Final Tests
Test #1:
score: 15
Accepted
time: 724ms
memory: 25380kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 53
Acceptable Answer
time: 4402ms
memory: 102304kb
input:
1000000 20 2000000 29091471
output:
Partially correct Case 2, 53 / 85, maxt = 8, maxs = 1102704 8188143693296750335 0.623529 10011996817885199269
result:
points 0.623529 Partially correct Case 2, 53 / 85, maxt = 8, maxs = 1102704