# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1111674 | n3rm1n | Art Collections (BOI22_art) | C++17 | 1391 ms | 1884 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;
const int MAXN = 4005;
int n, ans[MAXN];
void fillans(int x)
{
vector < int > g;
for (int i = x; i <= n; ++ i)
g.push_back(i);
for (int i = 1; i < x; ++ i)
g.push_back(i);
ans[x] = publish(g);
}
int p[MAXN];
void doanswer()
{
vector < int > g;
for (int i = 1; i <= n; ++ i)
g.push_back(p[i]);
answer(g);
}
void solve(int N)
{
n = N;
for (int i = 1; i <= n; ++ i)
fillans(i);
ans[n+1] = ans[1];
for (int i = 1; i <= n; ++ i)
{
int smallerminusbigger = ans[i+1] - ans[i];
p[(n - 1 - (smallerminusbigger))/2 + 1] = i;
}
doanswer();
}
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... |