QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#509838 | #9156. 百万富翁 | AdamGS# | 15 | 616ms | 23504kb | C++23 | 524b | 2024-08-08 19:05:54 | 2024-08-08 19:05:55 |
Judging History
answer
#include "richest.h"
#include<bits/stdc++.h>
using namespace std;
#define rep(a, b) for(int a = 0; a < (b); ++a)
#define st first
#define nd second
#define pb push_back
#define all(a) a.begin(), a.end()
int solve1(int n) {
vector<int>A, B;
rep(i, n) rep(j, i) {
A.pb(j); B.pb(i);
}
vector<int>C=ask(A, B);
vector<int>ile(n);
for(auto i : C) ++ile[i];
int ans=-1;
rep(i, n) if(ile[i]==n-1) ans=i;
return ans;
}
int richest(int n, int t, int s) {
if(t==1) return solve1(n);
return 2137;
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 15
Accepted
time: 603ms
memory: 22952kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 0
Wrong Answer
time: 11ms
memory: 23504kb
input:
1000000 20 2000000 29091473
output:
Wrong answer 4459638610240858557 0.000000 6906350380861515327
result:
points 0.0 Wrong answer
Final Tests
Test #1:
score: 15
Accepted
time: 616ms
memory: 22184kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 0
Wrong Answer
time: 8ms
memory: 23304kb
input:
1000000 20 2000000 29091471
output:
Wrong answer 4459638610240858557 0.000000 6906350380861515327
result:
points 0.0 Wrong answer