# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
582468 | tutis | Art Collections (BOI22_art) | C++17 | 0 ms | 0 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;
mt19937_64 rng(0);
void solve(int N)
{
int ans[N];
vector<int>P(N);
for (int t = 0; t < N; t++)
{
for (int i = 0; i < N; i++)
P[i] = (i + t) % N + 1;
ans[t] = publish(P);
}
for (int i = 0; i < N; i++)
{
int del = ans[i] - ans[(i + 1) % N];
//x k y
//k xy x
//xy k y
//del = y - x
//n-1 = x + y
//n-1-del = x+y+x-y =2x
int x = (n - 1 - del) / 2;
P[x] = i + 1;
}
answer(P);
}
int main()
{
}