# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
849875 | MinaRagy06 | Art Collections (BOI22_art) | C++17 | 1155 ms | 1708 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>
#include "art.h"
#ifdef MINA
#include "sample_grader.cpp"
#endif
using namespace std;
void solve(int n) {
vector<int> a(n);
for (int i = 0; i < n; i++) {
a[i] = i + 1;
}
int s = publish(a);
int diff[n]{};
for (int i = 1; i < n; i++) {
vector<int> b = a;
for (int j = i; j - 1 >= 0; j--) {
swap(b[j], b[j - 1]);
}
int news = publish(b);
diff[i] = news - s;
}
for (int i = 1; i < n; i++) {
int before = (diff[i] + i) / 2;
for (int j = i; j - 1 >= before; j--) {
swap(a[j], a[j - 1]);
}
}
answer(a);
}
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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |