#include "monster.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
std::vector<int> Solve(int N) {
std::vector<int> T(N);
for (int i=0; i<N; i++) for (int j = i+1; j<N; j++) Query(i, j) ? T[i]++ : T[j]++;
{
vector<int> t;
for (int i=0; i<N; i++) if (T[i] == 1) t.pb(i);
assert(t.size()==2);
int i = t[0]; int j = t[1];
if (Query(i, j)) T[i]--;
else T[j]--;
}
{
vector<int> t;
for (int i=0; i<N; i++) if (T[i] == N-2) t.pb(i);
assert(t.size()==2);
int i = t[0]; int j = t[1];
if (Query(i, j)) T[j]++;
else T[i]++;
}
return T;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |