# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
714448 | vjudge1 | Art Collections (BOI22_art) | C++17 | 0 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"
#define intt long long
#define pb push_back
#define endl '\n'
#define F first
#define S second
#define pii pair<int,int>
#define pll pair<intt,intt>
#define ld long double
#define fast_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
using namespace std;
const int sz = 2e5+5;
vector<int>v;
int n;
int inv;
bool cmp(int i, int j) {
swap(v[n-i], v[n-j]);
int inv1 = publish(v);
swap(v[n-i], v[n-j]);
return inv < inv1;
}
void solve(int N) {
for ( int i = 1; i <= N; i++ ){
v.pb(i);
}
n = N;
reverse(v.begin(), v.end());
inv = publish(v);
vector<int>res = v;
stable_sort(res.begin(),res.end(), cmp);
answer(res);
}
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... |