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 "swaps.h"
#include <bits/stdc++.h>
using namespace std;
#ifdef DEBUG
#include "/home/ioi/contests/debug.h"
#else
#define debug(...) void(37)
#endif
void solve(int N, int V) {
vector<int> ord(N);
iota(ord.begin(), ord.end(), 1);
for (int i = 0; i < N; ++i) {
vector<array<int, 2>> qs;
for (int j = i % 2; j + 1 < N; j += 2) {
debug(j);
schedule(ord[j], ord[j + 1]);
qs.push_back({j, j + 1});
}
auto res = visit();
for (int i = 0; i < int(res.size()); ++i) {
if (!res[i]) {
swap(ord[qs[i][0]], ord[qs[i][1]]);
}
}
}
answer(ord);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |