# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
603300 | DanerZein | Art Collections (BOI22_art) | C++17 | 111 ms | 300 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> ord;
for(int i=1;i<=N;i++) ord.push_back(i);
for(int i=1;i<N;i++){
vector<int> aux=ord;
int ra=publish(aux);
int d=max(0,i-ra);
aux.erase(aux.begin()+i);
aux.insert(aux.begin()+d,(i+1));
int ant=1e9;
for(int j=d;j<=i;j++){
int rp=publish(aux);
if(rp>ant){
swap(aux[j],aux[j-1]);
break;
}
if(j==i) break;
ant=rp;
swap(aux[j],aux[j+1]);
}
ord=aux;
}
answer(ord);
}
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... |