# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
950849 | Mr_Ph | Art Collections (BOI22_art) | C++17 | 1191 ms | 1824 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 "sample_grader.cpp"
#include<bits/stdc++.h>
using namespace std;
void solve(int n) {
vector<int>arr;
for(int i=1;i<=n;i++)
arr.push_back(i);
int x=publish(arr);
vector<int>xd;
xd.push_back(x);
for(int i=0;i<n-1;i++)
{
int prv=arr[n-1];
for(int j=n-2;j>=0;j--)
{
int o=arr[j];
arr[j]=prv;
prv=o;
}
arr[n-1]=prv;
x=publish(arr);
xd.push_back(x);
}
vector<int>ans(n);
for(int i=0;i<n;i++)
{
int a=xd[i],b=xd[(i+1)%n];
int lol=b-a;
int idx=-(lol-(n-1))/2;
// cout<<idx<<endl;
ans[idx]=i+1;
}
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... |