# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
951621 | phoenix0423 | Art Collections (BOI22_art) | C++17 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<ll, ll> pll;
#define fastio ios::sync_with_stdio(false), cin.tie(0)
#define pb push_back
#define eb emplace_back
#define f first
#define s second
#include "Art.h"
void solve(int n){
vector<int> p(n), ans(n, -1);
iota(p.begin(), p.end(), 1);
int prv = 0;
for(int i = 0; i < n; i++){
int cur = publish(p);
if(i){
ans[(n - 1 - (cur - prv)) / 2] = p[n - 1];
}
prv = cur;
p.pb(p.front());
p.erase(p.begin());
}
for(int i = 0; i < n; i++){
if(ans[i] == -1){
ans[i] = p[n - 1];
break;
}
}
answer(ans);
}