# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
964590 | aeg | Art Collections (BOI22_art) | C++17 | 1265 ms | 1864 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include "art.h"
#include <bits/stdc++.h>
using namespace std;
void solve(int n){
vector<int> def(n);
iota(def.begin() , def.end() , 1);
int curval = publish(def);
for(int i = 2; i<=n;i++){
vector<int> cur = def;
cur.erase(find(cur.begin() , cur.end() , i));
cur.insert(cur.begin() , i);
int tmpval = curval;
int curr = publish(cur);
int diff = curr - tmpval;
int ind = (i - 1 - diff) / 2 + diff;
curval = curr - ind;
def.erase(find(def.begin() , def.end() , i));
def.insert(def.begin() + ind , i);
}
answer(def);
}
Compilation message (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... |