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 <bits/stdc++.h>
#include "swaps.h"
#ifdef MINA
#include "grader.cpp"
#endif
using namespace std;
typedef int64_t ll;
void solve(int n, int v) {
vector<int> a(n);
for (int i = 0; i < n; i++) {
a[i] = i + 1;
}
for (int cur = 0; cur < v; cur++) {
for (int i = (cur & 1); i + 1 < n; i += 2) {
schedule(a[i], a[i + 1]);
}
vector<int> ret = visit();
int idx = 0;
for (int i = (cur & 1); i + 1 < n; i += 2) {
if (!ret[idx]) {
swap(a[i], a[i + 1]);
}
idx++;
}
}
answer(a);
}
# | 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... |