#include "monster.h"
#include <iostream>
namespace {
} // namespace
std::vector<int> Solve(int N) {
std::vector<int> T(N);
std::vector<int> counter(N);
for (int i = 0; i < N-1; i++) {
for (int j = i + 1; j < N; j++) {
if (Query(i, j)) {
counter[i]++;
}
else {
counter[j]++;
}
}
}
int a=-1, b=-1;
for (int i = 0; i < N; i++) {
if (counter[i] == 1) {
if (a == -1) {
a = i;
}
else {
b = i;
}
}
}
if (Query(a, b)) {
counter[a] = 0;
}
else {
counter[b] = 0;
}
int x = -1, y = -1;
for (int i = 0; i < N; i++) {
if (counter[i] == N-2) {
if (x == -1) {
x = i;
}
else {
y = i;
}
}
}
if (Query(x, y)) {
counter[y] = N-1;
}
else {
counter[x] = N-1;
}
return counter;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
284 KB |
Output is correct |
3 |
Correct |
1 ms |
200 KB |
Output is correct |
4 |
Correct |
1 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
200 KB |
Output is correct |
6 |
Correct |
1 ms |
200 KB |
Output is correct |
7 |
Correct |
1 ms |
200 KB |
Output is correct |
8 |
Correct |
0 ms |
200 KB |
Output is correct |
9 |
Correct |
1 ms |
200 KB |
Output is correct |
10 |
Correct |
1 ms |
200 KB |
Output is correct |
11 |
Correct |
0 ms |
200 KB |
Output is correct |
12 |
Correct |
1 ms |
200 KB |
Output is correct |
13 |
Correct |
1 ms |
200 KB |
Output is correct |
14 |
Correct |
1 ms |
200 KB |
Output is correct |
15 |
Correct |
1 ms |
200 KB |
Output is correct |
16 |
Correct |
183 ms |
200 KB |
Output is correct |
17 |
Correct |
196 ms |
200 KB |
Output is correct |
18 |
Correct |
146 ms |
200 KB |
Output is correct |
19 |
Correct |
165 ms |
200 KB |
Output is correct |
20 |
Correct |
216 ms |
200 KB |
Output is correct |
21 |
Correct |
0 ms |
200 KB |
Output is correct |
22 |
Correct |
1 ms |
200 KB |
Output is correct |
23 |
Correct |
1 ms |
200 KB |
Output is correct |
24 |
Correct |
1 ms |
200 KB |
Output is correct |
25 |
Correct |
1 ms |
200 KB |
Output is correct |
26 |
Correct |
184 ms |
280 KB |
Output is correct |
27 |
Correct |
1 ms |
200 KB |
Output is correct |
28 |
Correct |
0 ms |
200 KB |
Output is correct |
29 |
Correct |
0 ms |
200 KB |
Output is correct |
30 |
Correct |
1 ms |
200 KB |
Output is correct |
31 |
Correct |
1 ms |
280 KB |
Output is correct |
32 |
Correct |
200 ms |
200 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
200 KB |
Output is correct |
2 |
Correct |
0 ms |
284 KB |
Output is correct |
3 |
Correct |
1 ms |
200 KB |
Output is correct |
4 |
Correct |
1 ms |
200 KB |
Output is correct |
5 |
Correct |
1 ms |
200 KB |
Output is correct |
6 |
Correct |
1 ms |
200 KB |
Output is correct |
7 |
Correct |
1 ms |
200 KB |
Output is correct |
8 |
Correct |
0 ms |
200 KB |
Output is correct |
9 |
Correct |
1 ms |
200 KB |
Output is correct |
10 |
Correct |
1 ms |
200 KB |
Output is correct |
11 |
Correct |
0 ms |
200 KB |
Output is correct |
12 |
Correct |
1 ms |
200 KB |
Output is correct |
13 |
Correct |
1 ms |
200 KB |
Output is correct |
14 |
Correct |
1 ms |
200 KB |
Output is correct |
15 |
Correct |
1 ms |
200 KB |
Output is correct |
16 |
Correct |
183 ms |
200 KB |
Output is correct |
17 |
Correct |
196 ms |
200 KB |
Output is correct |
18 |
Correct |
146 ms |
200 KB |
Output is correct |
19 |
Correct |
165 ms |
200 KB |
Output is correct |
20 |
Correct |
216 ms |
200 KB |
Output is correct |
21 |
Correct |
0 ms |
200 KB |
Output is correct |
22 |
Correct |
1 ms |
200 KB |
Output is correct |
23 |
Correct |
1 ms |
200 KB |
Output is correct |
24 |
Correct |
1 ms |
200 KB |
Output is correct |
25 |
Correct |
1 ms |
200 KB |
Output is correct |
26 |
Correct |
184 ms |
280 KB |
Output is correct |
27 |
Correct |
1 ms |
200 KB |
Output is correct |
28 |
Correct |
0 ms |
200 KB |
Output is correct |
29 |
Correct |
0 ms |
200 KB |
Output is correct |
30 |
Correct |
1 ms |
200 KB |
Output is correct |
31 |
Correct |
1 ms |
280 KB |
Output is correct |
32 |
Correct |
200 ms |
200 KB |
Output is correct |
33 |
Incorrect |
205 ms |
284 KB |
Wrong Answer [6] |
34 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Incorrect |
246 ms |
284 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |