# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120195 | vjudge1 | Art Collections (BOI22_art) | C++17 | 146 ms | 512 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;
typedef long long ll;
vector<int> ord;
int cnt, n;
void solve(int N) {
n = N;
vector<int> p(n);
for(int i = 0; i < n; i++) {
p[i] = i + 1;
}
int cur = publish(p);
for(int i = 1; i < n; i++) {
int j = i - 1;
swap(p[i], p[j]);
int t = publish(p);
while(j >= 0 && t < cur) {
j--;
if(j >= 0) swap(p[j], p[j + 1]);
cur = t;
t = publish(p);
}
if(j >= 0) {
swap(p[j], p[j + 1]);
}
}
answer(p);
}
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... |