# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
574229 | stevancv | Art Collections (BOI22_art) | C++17 | 1529 ms | 696 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"
#define ll long long
#define ld long double
#define sp ' '
#define en '\n'
#define smin(a, b) a = min(a, b)
#define smax(a, b) a = max(a, b)
using namespace std;
const int N = 2e5 + 2;
void solve(int n) {
vector<int> ans(n);
iota(ans.begin(), ans.end(), 1);
int prv = publish(ans);
for (int i = 1; i < n; i++) {
vector<int> v;
v.push_back(i + 1);
for (int j = 0; j < n; j++) {
if (ans[j] != i + 1) v.push_back(ans[j]);
}
int y = publish(v);
int o = (prv + y - i) / 2;
int gde = y - o;
for (int j = i; j > gde; j--) {
swap(ans[j], ans[j - 1]);
}
prv = o;
}
answer(ans);
}
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... |