| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1188890 | wstcube | Art Collections (BOI22_art) | C++20 | 0 ms | 408 KiB |
#include "art.h"
#include <vector>
#include <algorithm>
#include <numeric>
#include <iostream>
#define ll long long
using namespace std;
void solve(int N) {
vector<int> order(N),ii(N);
iota(order.begin(),order.end(),1);
ll res1,res2,a1,a2;
for (int i = 0; i < N - 1; i++) {
bool swapped = false;
for (int j = 0; j < N -i - 1; j++) {
a1=order[j];a2=order[j+1];
ii[0]=a1; ii[1] =a2;
int val=1;
for(int k=2;k<N;k++){
if(val==a1) val++;
if(val==a2) val++;
ii[k] = val;
val++;
}
res1=publish(ii);
swap(ii[0],ii[1]);
res2=publish(ii);
if (res1>res2) {
swap(order[j], order[j + 1]);
swapped = true;
}
}
if(!swapped) answer(order);
}
answer(order);
}
| # | 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... | ||||
