/*
Author : DeMen100ns (a.k.a Vo Khac Trieu)
School : VNU-HCM High school for the Gifted
fuck you adhoc
*/
#include <monster.h>
namespace {
const int N = 1005;
bool f[N][N];
int cnt[N];
};
std::vector<int> Solve(int n)
{
for(int i = 0; i < n; ++i){
for(int j = i + 1; j < n; ++j){
f[i][j] = Query(i, j);
cnt[i] += f[i][j];
cnt[j] += (!f[i][j]);
}
}
std::vector <int> ans(n);
int luu01 = -1, luu02 = -1, luun1 = -1, luun2 = -1;
for(int i = 0; i < n; ++i){
if (cnt[i] > 1 && cnt[i] < n - 1){
ans[i] = cnt[i] - 1;
}
if (cnt[i] == 1){
if (luu01 == -1) luu01 = i;
else luu02 = i;
}
if (cnt[i] == n - 1){
if (luun1 == -1) luun1 = i;
else luun2 = i;
}
}
//0 1 2 3 4 5
//1 1 2 3 4 4
ans[luu01] = ans[luu02] = 1;
if (f[luu01][luu02]) ans[luu01] = 0;
else ans[luu02] = 0;
ans[luun1] = ans[luun2] = n - 1;
if (f[luun1][luun2]) ans[luun1] = n - 2;
else ans[luun2] = n - 2;
return ans;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
1 ms |
336 KB |
Execution killed with signal 6 |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
225 ms |
284 KB |
Wrong Answer [6] |
2 |
Halted |
0 ms |
0 KB |
- |