QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#537833 | #9156. 百万富翁 | aufan# | 15 | 611ms | 25424kb | C++17 | 501b | 2024-08-30 18:56:35 | 2024-08-30 18:56:35 |
Judging History
answer
#include "richest.h"
#include <bits/stdc++.h>
using namespace std;
int richest(int n, int t, int s) {
vector<int> a, b;
for (int i = 0; i < n; i++) {
for (int j = i + 1; j < n; j++) {
a.push_back(i);
b.push_back(j);
}
}
int ans = 0;
vector<int> ret = ask(a, b), cnt(n);
for (int i = 0; i < n * (n - 1) / 2; i++) {
cnt[ret[i]] += 1;
if (cnt[ret[i]] == n - 1) ans = ret[i];
}
return ans;
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 15
Accepted
time: 611ms
memory: 25424kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 0
Memory Limit Exceeded
input:
1000000 20 2000000 29091473
output:
Unauthorized output
result:
Final Tests
Test #1:
score: 15
Accepted
time: 605ms
memory: 25188kb
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