# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
796751 | TheSahib | Art Collections (BOI22_art) | C++17 | 1341 ms | 636 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>
using namespace std;
vector<int> v;
int x = 0;
int arr[4005];
bool comp(int a, int b){
return arr[a] > arr[b];
}
void solve(int N) {
v.resize(N);
iota(v.begin(), v.end(), 1);
vector<int> abc;
for (int i = 0; i < N; i++)
{
abc.push_back(publish(v));
v.insert(v.begin(), v.back());
v.pop_back();
}
for (int i = 0; i < N; i++)
{
int j = (1 + i) % N;
arr[N - i] = abc[(j - 1 + N) % N] - abc[j];
}
vector<int> ans(N);
iota(ans.begin(), ans.end(), 1);
stable_sort(ans.begin(), ans.end(), comp);
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... |