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 "monster.h"
#include <bits/stdc++.h>
using namespace std;
std::vector<int> Solve(int N) {
std::vector<int> T(N);
vector<int> cnt(N);
vector<int> amb1, amb2;
for(int i = 0; i < N; i++){
for(int j = 0; j < N; j++) if(j != i) cnt[i] += Query(i, j);
if(cnt[i] == 1) amb1.push_back(i);
if(cnt[i] == N-2) amb2.push_back(i);
}
(Query(amb1[0], amb1[1]) ? cnt[amb1[0]] : cnt[amb1[1]])--;
(Query(amb2[0], amb2[1]) ? cnt[amb2[1]] : cnt[amb2[0]])++;
for (int i = 0; i < N; i++) T[i] = cnt[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... |