# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1120323 | vjudge1 | Art Collections (BOI22_art) | C++17 | 2 ms | 504 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"
using namespace std;
int u[4001];
void solve (int n){
vector<int>v;
for(int i=1;i<=n;i++){
v.push_back(i);
}
int k=publish(v);
if(k==0){
answer(v);
return;
}
for(int i=n-1;i>=0;i--){
if(u[i]==0){
k=publish(v);
if(k==0){
answer(v);
return;
}
int x;
int j=i;
for(int l=j-1;l>=0;l--){
swap(v[j],v[l]);
x=publish(v);
if(x==0){
answer(v);
return;
}
if(x<=k){
k=x;
j=l;
}
else{
swap(v[j],v[l]);
}
}
u[j]=1;
i++;
}
}
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... |