이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/*
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 = 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 luu1 = -1, luu2 = -1;
for(int i = 0; i < n; ++i){
if (cnt[i] < n - 1){
ans[i] = cnt[i] - 1;
} else{
if (luu1 == -1) luu1 = i;
else luu2 = i;
}
}
ans[luu1] = ans[luu2] = n - 1;
if (f[luu1][luu2]) ans[luu1] = n - 2;
else ans[luu2] = n - 2;
return ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |