QOJ.ac
QOJ
ID | Problem | Submitter | Result | Time | Memory | Language | File size | Submit time | Judge time |
---|---|---|---|---|---|---|---|---|---|
#502342 | #9156. 百万富翁 | alexz1205# | 15 | 641ms | 46988kb | C++14 | 492b | 2024-08-03 04:04:37 | 2024-08-03 04:04:39 |
Judging History
answer
#include <bits/stdc++.h>
#include "richest.h"
using namespace std;
int richest(int N, int T, int S){
if (T == 1){
vector<int> a, b;
for (int x = 0; x < N; x ++){
for (int y = x+1; y < N; y ++){
a.push_back(x);
b.push_back(y);
}
}
vector<int> c = ask(a, b);
int ma = 0;
int check = 0, cur = 0;
for (int x = 1; x < N; x ++){
cur += N-x;
if (c[check + x-ma-1] == x){
ma = x;
check = cur;
}
}
return ma;
}
return 0;
}
Details
Tip: Click on the bar to expand more detailed information
Pretests
Pretest #1:
score: 15
Accepted
time: 641ms
memory: 25308kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 0
Wrong Answer
time: 16ms
memory: 46900kb
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: 630ms
memory: 25208kb
input:
1000 1 499500 957319857
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Test #2:
score: 0
Wrong Answer
time: 12ms
memory: 46988kb
input:
1000000 20 2000000 29091471
output:
Wrong answer 4459638610240858557 0.000000 6906350380861515327
result:
points 0.0 Wrong answer