# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
949776 | Dec0Dedd | Art Collections (BOI22_art) | C++17 | 1240 ms | 64284 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;
typedef long long ll;
typedef pair<int, int> pii;
void solve(int n) {
vector<int> v[n+1]={};
for (int i=1; i<=n; ++i) v[1].push_back(i);
int vl[n+1]={}; vl[1]=publish(v[1]);
for (int i=2; i<=n; ++i) {
v[i]=v[i-1];
v[i].erase(v[i].begin());
v[i].push_back(i-1);
vl[i]=publish(v[i]);
}
vector<int> ans(n, 0);
for (int i=1; i+1<=n; ++i) {
int s1=vl[i], s2=vl[i+1];
int k=s1-s2+n+1; assert(k%2 == 0);
ans[k/2-1]=i;
}
for (int i=0; i<n; ++i) {
if (ans[i] == 0) ans[i]=n;
} 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... |