| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 1286216 | SmuggingSpun | Art Collections (BOI22_art) | C++20 | 70 ms | 408 KiB |
#include "art.h"
#include<bits/stdc++.h>
using namespace std;
void solve(int n){
if(n <= 6){
vector<int>p(n);
iota(p.begin(), p.end(), 1);
do{
if(publish(p) == 0){
answer(p);
return;
}
} while(next_permutation(p.begin(), p.end()));
}
if(n <= 444){
vector<int>p(n), ans(1, 1);
iota(p.begin(), p.end(), 1);
for(int i = 2, init = publish(p); i <= n; i++){
int low = 0, high = i - 2, pos = 0;
while(low <= high){
int mid = (low + high) >> 1;
swap(p[i - 1], p[ans[mid] - 1]);
if(publish(p) > init){
low = pos = mid + 1;
}
else{
high = mid - 1;
}
swap(p[i - 1], p[ans[mid] - 1]);
}
ans.insert(ans.begin() + pos, i);
}
answer(ans);
return;
}
}| # | 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... | ||||
