# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
672062 | LittleCube | Art Collections (BOI22_art) | C++17 | 1536 ms | 676 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>
#define ll long long
#define pii pair<int, int>
#define pll pair<ll, ll>
#define F first
#define S second
using namespace std;
int vis[4005], arr[4005];
void solve(int N)
{
vector<int> ans(N);
for (int i = 1; i <= N; i++)
{
vector<int> v;
for (int j = i; j <= N; j++)
v.emplace_back(j);
for (int j = 1; j < i; j++)
v.emplace_back(j);
arr[i] = publish(v);
}
arr[N + 1] = arr[1];
for (int i = 1; i <= N; i++)
{
// A + B = N - 1, B - A = arr[i + 1] - arr[i];
int A = N - 1 + arr[i] - arr[i + 1];
A /= 2;
ans[A] = 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... |