QOJ.ac
QOJ
ID | 题目 | 提交者 | 结果 | 用时 | 内存 | 语言 | 文件大小 | 提交时间 | 测评时间 |
---|---|---|---|---|---|---|---|---|---|
#492224 | #9156. 百万富翁 | zfs732# | 15 | 612ms | 23428kb | C++23 | 665b | 2024-07-26 10:34:33 | 2024-07-26 10:34:33 |
Judging History
answer
#include "richest.h"
int richest(int N, int T, int S) {
if (T == 1) {
std::vector g(N, std::vector<bool>(N));
std::vector<int> A, B;
for (int i = 0; i < N; i++)
for (int j = i + 1; j < N; j++) {
A.emplace_back(i);
B.emplace_back(j);
}
auto res = ask(A, B);
for (int i = 0, tot = 0; i < N; i++)
for (int j = i + 1; j < N; j++) {
int c = res[tot++] == i;
g[i][j] = c, g[j][i] = !c;
}
for (int i = 0; i < N; i++) {
int cnt = 0;
for (int j = 0; j < N; j++)
cnt += g[i][j];
if (cnt == N - 1)
return i;
}
}
return 1;
}
详细
Pretests
Pretest #1:
score: 15
Accepted
time: 604ms
memory: 23232kb
input:
1000 1 499500 957319859
output:
Correct 7127326332295218295 1.000000 1331569654267968081
result:
points 1.0 Correct
Pretest #2:
score: 0
Wrong Answer
time: 12ms
memory: 23348kb
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: 612ms
memory: 23256kb
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: 23428kb
input:
1000000 20 2000000 29091471
output:
Wrong answer 4459638610240858557 0.000000 6906350380861515327
result:
points 0.0 Wrong answer