This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<iostream>
#include<algorithm>
#include<vector>
using namespace std;
typedef long long ll;
#include "monster.h"
const int N = 200 + 2;
bool a[N][N], mark[N];
int cnt[2];
vector<int> Solve(int n) {
for (int i = 0; i < n; ++i)
for (int j = 0; j < i; ++j)
a[i][j] = Query(i, j), a[j][i] = a[i][j] ^ 1;
vector<int> ans(n, 0);
for (int i = n - 1; i; --i) {
for (int j = 0; j < n; ++j) if (!mark[j]) {
cnt[0] = cnt[1] = 0;
for (int k = 0; k < n; ++k) if (k != j && !mark[k])
++cnt[a[j][k]];
if (cnt[1] == i && cnt[0] == 1) {
ans[j] = i;
mark[j] = true;
break;
}
}
}
return ans;
}
/** /\_/\
* (= ._.)
* / >0 \>1
**/
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |