#include <bits/stdc++.h>
#include "art.h"
using namespace std;
using ll = long long;
using pii = pair<int, int>;
#define pb push_back
#define ff first
#define ss second
void solve(int n){
vector<int> b;
for (int i = 1; i <= n; i++){
b.pb(i);
}
int u = publish(b);
for (int i = 2; i <= n; i++){
vector<int> c = {i};
for (int j = 1; j < i; j++){
c.pb(b[j - 1]);
}
for (int j = i + 1; j <= n; j++){
c.pb(b[j - 1]);
}
int v = publish(c);
int S = (v + u - (i - 1)) / 2;
int x = u - S; x = (i - 1) - x;
b.erase(b.begin() + (i - 1));
b.insert(b.begin() + x, i);
u -= ((i - 1) - x);
}
answer(b);
}
# | 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... |