#include <bits/stdc++.h>
#include <monster.h>
using namespace std;
bool Query(int a, int b);
std::vector<int> Solve(int N) {
vector<int> T(N);
if(N == 1) return T;
vector<int> win(N);
for(int i = 0; i < N; i++) {
for(int j = i + 1; j < N; j++) {
if(Query(i, j)) ++win[i];
else ++win[j];
}
}
for(int i = 0; i < N; i++) {
if(win[i] < N - 2 && win[i] > 1)
T[i] = win[i];
}
if(N == 2) {
for(int i = 0; i < N; i++)
T[i] = 1 - win[i];
return T;
}
for(int i = 0; i < N; i++) {
for(int j = i + 1; j < N; j++) {
if(win[i] == 1 && win[j] == 1) {
if(Query(i, j))
T[i] = 0, T[j] = 1;
}
}
}
for(int i = 0; i < N; i++) {
for(int j = i + 1; j < N; j++) {
if(win[i] == N - 2 && win[j] == N - 2)
if(Query(i, j))
T[i] = N - 2, T[j] = N - 1;
}
}
return T;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1 ms |
204 KB |
Wrong Answer [3] |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
213 ms |
280 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |