# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
613645 | Mohammed_Atalah | Art Collections (BOI22_art) | C++17 | 112 ms | 292 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);
for (int i = 1; i < N ; i++) {
for (int j = i - 1 ; j >= 0; j--) {
int a = v[j];
int b = v[j + 1];
v[j] = b;
v[j + 1] = a;
int w = publish(v);
if (w > e) {
v[j] = a;
v[j + 1] = b;
break;
} else {
e = w;
}
}
if (e == 0) {
break;
}
}
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... |