# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
714446 | vjudge1 | Art Collections (BOI22_art) | C++17 | 180 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;
int inv;
int n;
bool cmp(int i, int j) {
vector<int>v;
for ( int k = 1; k <= n; k++ ) if(k != i and k != j) v.pb(k);
v.pb(i);v.pb(j);
int inv1 = publish(v);
v.pop_back();v.pop_back();
v.pb(j);v.pb(i);
int inv2 = publish(v);
return inv1 < inv2;
}
void solve(int N) {
n = N;
vector<int>res;
for ( int i = 1; i <= n; i++ ) res.pb(i);
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... |