# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
692087 | Alexandruabcde | Art Collections (BOI22_art) | C++17 | 1621 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 "art.h"
#include <bits/stdc++.h>
using namespace std;
constexpr int NMAX = 4005;
int val_spate[NMAX];
int poz[NMAX];
void solve(int N) {
vector <int> V;
for (int i = 1; i <= N; ++ i )
V.push_back(i);
for (int i = N; i >= 1; -- i ) {
val_spate[i] = publish(V);
V.clear();
for (int j = i; j <= N; ++ j )
V.push_back(j);
for (int j = 1; j < i; ++ j )
V.push_back(j);
}
val_spate[0] = val_spate[N];
for (int i = N; i >= 1; -- i ) {
int spate = val_spate[i];
int fata = val_spate[i-1];
poz[i] = (fata - spate + N + 1) / 2;
}
V.clear();
V.resize(N);
for (int i = 1; i <= N; ++ i )
V[poz[i]-1] = i;
answer(V);
}
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... |