| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1246240 | svtk | Art Collections (BOI22_art) | C++20 | 54 ms | 396 KiB |
#include "art.h"
using namespace std;
void solve(int N) {
vector<int> order;
vector<int> rorder;
for(int i=1; i<=N; i++){
order.push_back(i);
rorder.push_back(N-i+1);
}
int last_ans = publish(order);
if(last_ans > N*(N-1)/2){
order = rorder;
last_ans = N*(N-1)/2 - last_ans;
}
int i=0;
int j = 0;
while(last_ans > 0){
int i=0;
while(i<N-1-j){
swap(order[i], order[i+1]);
int new_ans = publish(order);
if(new_ans > last_ans){
swap(order[i], order[i+1]);
} else {
last_ans = new_ans;
}
i++;
}
j++;
}
answer(order);
}
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
