# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
101296 | aome | Swap (BOI16_swap) | C++17 | 64 ms | 4896 KiB |
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>
using namespace std;
const int N = 200005;
int n, p[N];
int res[N];
bool flag[N];
bool visit[N];
void brute() {
vector<int> opt;
for (int i = 1; i <= n; ++i) opt.push_back(p[i]);
for (int i = 0; i < (1 << (n - 1)); ++i) {
vector<int> vec;
for (int j = 1; j <= n; ++j) vec.push_back(p[j]);
for (int j = 2; j <= n; ++j) {
if (i >> (j - 2) & 1) {
swap(vec[j - 1], vec[j / 2 - 1]);
}
}
if (opt > vec) opt = vec;
}
for (auto i : opt) cout << i << ' '; cout << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin >> n;
Compilation message (stderr)
# | 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... |