QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#495273 | #9156. 百万富翁 | TimDee# | 68.99999 | 1891ms | 84556kb | C++17 | 1.4kb | 2024-07-27 19:49:03 | 2024-07-27 19:49:03 |
Judging History
answer
#include "richest.h"
#include <bits/stdc++.h>
using namespace std;
#define forn(i,n) for(int i=0; i<(n); ++i)
#define pb push_back
#define pi pair<int,int>
#define f first
#define s second
#define all(x) x.begin(), x.end()
int richest(int n, int T, int S) {
if (T==1) {
vector<int> f,s;
forn(i,n) forn(j,i) {f.pb(j); s.pb(i);}
auto z = ask(f,s);
vector<pi> cnt(n);
forn(i,n) cnt[i].s=i;
for(auto&x:z) cnt[x].f++;
sort(all(cnt));
return cnt[n-1].s;
}
vector<int> a; forn(i,n) a.pb(i);
for(int it=0; it<6; ++it) {
vector<int> f,s;
for(int i=0; i<a.size(); i+=2) {
f.pb(a[i]);
s.pb(a[i+1]);
}
auto z = ask(f,s);
a = z;
}
vector<int> cnt(n);
for(int it=0; it<3; ++it) {
vector<int> f,s;
for(int i=0; i<a.size(); i+=5) {
for(int x=0; x<5; ++x) {
for(int y=x+1; y<5; ++y) {
f.pb(a[i+x]);
s.pb(a[i+y]);
}
}
}
auto z = ask(f,s);
for(auto&x:z) cnt[x]++;
vector<int> b;
forn(i,n) if (cnt[i]==4) b.pb(i);
forn(i,n) cnt[i]=0;
a=b;
}
vector<int> f,s;
forn(i,125) forn(j,i) {f.pb(a[j]); s.pb(a[i]);}
auto z = ask(f,s);
for(auto&x:z) cnt[x]++;
forn(i,n) if (cnt[i]==124) return i;
}
詳細信息
Pretests
Pretest #1:
score: 15
Accepted
time: 606ms
memory: 22904kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 54
Acceptable Answer
time: 1891ms
memory: 84428kb
input:
1000000 20 2000000 29091473
output:
Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1030875 2854925347767663157 0.635294 4439523384460221017
result:
points 0.635294 Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1030875
Final Tests
Test #1:
score: 15
Accepted
time: 613ms
memory: 22144kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 54
Acceptable Answer
time: 1853ms
memory: 84556kb
input:
1000000 20 2000000 29091471
output:
Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1030875 2854925347767663157 0.635294 4439523384460221017
result:
points 0.635294 Partially correct Case 2, 54 / 85, maxt = 10, maxs = 1030875