# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1092853 | irmuun | Art Collections (BOI22_art) | C++17 | 1257 ms | 1580 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;
#define ll long long
#define pb push_back
#define ff first
#define ss second
#define all(s) s.begin(),s.end()
#define rall(s) s.rbegin(),s.rend()
void solve(int N){
vector<int>R(N);
vector<int>ans(N);
vector<int>cnt(N+5,0);
iota(all(R),1);
for(int i=1;i<=N;i++){
cnt[i]=publish(R);
rotate(R.begin(),R.begin()+1,R.end());
}
for(int i=1;i<=N;i++){
int nxt=i+1;
if(nxt>N) nxt=1;
int A=cnt[i],B=cnt[nxt];
for(int x=0;x<N;x++){
int y=(N-1)-x;
if(x-y==A-B){
ans[x]=i;
break;
}
}
}
answer(ans);
return;
}
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... |