QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#495185 | #9156. 百万富翁 | TimDee# | 15 | 622ms | 22872kb | C++17 | 546b | 2024-07-27 19:22:45 | 2024-07-27 19:22:45 |
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;
}
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 15
Accepted
time: 619ms
memory: 22872kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 0
Time Limit Exceeded
input:
1000000 20 2000000 29091473
output:
Unauthorized output
result:
Final Tests
Test #1:
score: 15
Accepted
time: 622ms
memory: 22240kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 0
Memory Limit Exceeded
input:
1000000 20 2000000 29091471
output:
Unauthorized output