# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
967446 | penguin133 | Art Collections (BOI22_art) | C++17 | 1141 ms | 1852 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>
using namespace std;
#include "art.h"
//#define int long long
#define pi pair<int, int>
#define pii pair<int, pi>
#define fi first
#define se second
#ifdef _WIN32
#define getchar_unlocked _getchar_nolock
#endif
mt19937_64 rng(chrono::steady_clock::now().time_since_epoch().count());
void solve(int N) {
vector <int> x;
vector <int> ans(N);
for(int i = 1; i <= N; i++)x.push_back(i);
vector <int> res;
for(int i = 1; i <= N; i++){
res.push_back(publish(x));
x.erase(x.begin());
x.push_back(i);
}
res.push_back(res[0]);
for(int i = 1; i <= N; i++){
int diff = res[i] - res[i - 1];
int br = (diff + N - 1) / 2;
assert((diff + N - 1) % 2 == 0);
int tot = br - diff;
ans[tot] = i;
}
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... |