# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
871811 | imarn | Art Collections (BOI22_art) | C++17 | 1213 ms | 1560 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 f first
#define s second
#define ll long long
#define pb push_back
#define pii pair<int,int>
#define pll pair<ll,ll>
#define sz(x) (int)x.size()
#define all(x) x.begin(),x.end()
using namespace std;
/*int x[4]={0,1,3,2};
int publish(vector<int>a){
int cnt=0;
for(int i=0;i<a.size();i++){
for(int j=0;j<i;j++){
if(x[a[i]]<x[a[j]])cnt++;
}
}return cnt;
}*/
void solve(int N) {
vector<int>a(N);
int ans[N+1];
for(int i=0;i<N;i++)a[i]=i+1;
int tt1=publish(a);int st=tt1;
for(int i=1;i<=N-1;i++){
for(int j=i;j<N;j++)a[j]=j-i+1;
for(int j=0;j<i;j++)a[j]=N-i+j+1;
int tt2=publish(a);
ans[N-i+1]=(N-1+tt2-tt1)/2;
tt1=tt2;
}ans[1]=(N-1+st-tt1)/2;
vector<int>ord(N);
for(int i=1;i<=N;i++)ord[ans[i]]=i;
answer(ord);
//for(int i=0;i<N;i++)cout<<ord[i]<<" ";
}
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... |