# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
623864 | Alma | Art Collections (BOI22_art) | C++17 | 1591 ms | 740 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;
#define fi first
#define se second
using ll = long long;
using ii = pair<int,int>;
const int INF = 1e9;
const ll LLINF = 1e18;
using vi = vector<int>;
using vvi = vector<vi>;
// prev: K
// act - prev: RES = (K-i) + (N-1 - i) - K = N-2i-1
// i = (N - RES - 1) / 2
void solve (int N) {
vi vec(N), res(N), ans(N);
for (int i = 0; i < N; i++) {
vec[i] = i+1;
}
for (int i = 0; i < N; i++) {
res[i] = publish(vec);
rotate(vec.begin(), vec.begin()+1, vec.end());
}
for (int i = 0; i < N; i++) {
int pos = (N - res[(i+1) % N] + res[i] - 1) / 2;
ans[pos] = i+1;
}
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... |