이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "monster.h"
#include <bits/stdc++.h>
using namespace std;
namespace {
bool example_variable;
} // namespace
vector<int> Solve(int N) {
vector<int> v(N), ans(N), ret(N);
for (int i = 0; i<N; ++i) {
ans[i] = i;
for (int j = i+1; j<N; ++j) {
++v[Query(i,j) ? i : j];
}
}
sort(ans.begin(), ans.end(), [&](int a, int b) {return v[a] < v[b];});
if (!Query(ans[0], ans[1])) swap(ans[0], ans[1]);
if (!Query(ans[N-2], ans[N-1])) swap(ans[N-2], ans[N-1]);
for (int i = 0; i<N; ++i) ret[ans[i]] = i;
return ret;
}
컴파일 시 표준 에러 (stderr) 메시지
monster.cpp:6:6: warning: '{anonymous}::example_variable' defined but not used [-Wunused-variable]
6 | bool example_variable;
| ^~~~~~~~~~~~~~~~
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |