# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
613730 | Mohammed_Atalah | Art Collections (BOI22_art) | C++17 | 1 ms | 208 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 "art.h"
#include <bits/stdc++.h>
using namespace std;
void solve(int N) {
vector<int> v;
for (int i = 1; i <= N; i++) {
v.push_back(i);
}
int e = publish(v);
int last;
for (int i = 1; i < N ; i++) {
int l = 0; int r = i;
last = i;
while (l <= r) {
vector<int> vv = v;
int mid = (l + r) / 2;
int u = v[last];
for (int j = last - 1; j >= mid; j--) {
vv[j + 1] = vv[j];
}
vv[mid] = u;
int w = publish(vv);
if (w > e) {
l = mid + 1;
} else {
r = mid - 1;
e = w;
last = mid;
v = vv;
}
}
}
answer(v);
}
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... |