# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
914404 | hngwlog | Art Collections (BOI22_art) | C++17 | 1184 ms | 1696 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 n, cur = - 1;
void process(int cnt, vector<int> &a, vector<int> &ans) {
vector<int> b;
for (int i = 0; i < n - cnt - 1; i++) b.push_back(a[i]);
for (int i = n - cnt; i < n; i++) b.push_back(a[i]);
b.push_back(a[n - cnt - 1]);
int nex = publish(b);
int num = (nex - cur + cnt) / 2;
vector<int> nAns;
for (int i = 0; i < cnt - num; i++) nAns.push_back(ans[i]);
nAns.push_back(a[n - cnt - 1]);
for (int i = cnt - num; i < cnt; i++) nAns.push_back(ans[i]);
ans.swap(nAns);
a.swap(b);
cur = nex;
}
void solve(int N) {
n = N;
vector<int> a;
for (int i = 1; i <= n; i++) a.push_back(i);
cur = publish(a);
vector<int> ans;
ans.push_back(n);
for (int i = 1; i < n; i++) process(i, a, ans);
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... |