# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
647344 | Pety | Art Collections (BOI22_art) | C++17 | 1591 ms | 832 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"
#define ll long long
using namespace std;
const int INF = 1e9;
const int MOD = 1e9 + 7;
void solve(int N) {
vector<int>R;
for (int i = 1; i <= N; i++)
R.push_back(i);
int value = publish(R);
vector<int>ans = {1};
for (int i = 2; i <= N; i++) {
vector<int>R2 = {i};
for (int j = 1; j <= N; j++)
if (j != i) {
R2.push_back(j);
}
int value2 = publish(R2);
///x + y = i - 1
///x - y = value - value2
///x-->alea mai jos, y-->alea mai sus
int x = (i - 1 + value - value2) / 2;
int y = i - 1 - x;
ans.push_back(0);
for (int j = ans.size() - 2; j >= y; j--)
ans[j + 1] = ans[j];
ans[y] = 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... |