# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
715927 | ismayil | Art Collections (BOI22_art) | C++17 | 1780 ms | 784 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "art.h"
#include<bits/stdc++.h>
using namespace std;
// g++ -std=c++17 art_sample.cpp sample_grader.cpp
int n;
int f(){
vector<int> order;
for (int i = 1; i <= n; i++)
{
order.push_back(i);
}
return publish(order);
}
int f_inv(int a){
vector<int> order;
for (int i = 1; i <= n; i++)
{
if(i == a) continue;
order.push_back(i);
}
order.push_back(a);
return publish(order);
}
int cell[4001];
void solve(int N) {
n = N;
vector<int> ans(n, 0);
int inv = f();
for (int i = 1; i < n; i++)
{
int ninv = f_inv(i);
/*
inv = x + y + pos(i);
ninv = n - i - pos(i) + x + y;
inv - ninv = pos(i) - n + i + pos(i)
2 * pos(i) = inv - ninv + n - i
*/
int pos = (inv - ninv + n - i) / 2;
//cout << i << " " << pos << endl;
for(int j = 0; j < n; j++){
if(cell[j] == 0 && pos == 0){
ans[j] = i;
cell[j] = 1;
break;
}
if(cell[j] == 0) pos--;
}
}
for(int j = 0; j < n; j++){
if(cell[j] == 0){
ans[j] = n;
cell[j] = 1;
break;
}
}
answer(ans);
}
컴파일 시 표준 에러 (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... |