# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
653524 | prvocislo | Art Collections (BOI22_art) | C++17 | 1501 ms | 720 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 <algorithm>
#include <bitset>
#include <cassert>
#include <chrono>
#include <cmath>
#include <deque>
#include <iomanip>
#include <iostream>
#include <map>
#include <queue>
#include <random>
#include <set>
#include <string>
#include <vector>
typedef long long ll;
typedef long double ld;
using namespace std;
// publish(order), answer(order)
void solve(int n)
{
vector<int> v(n);
for (int i = 0; i < n; i++) v[i] = i + 1;
int a = publish(v);
for (int i = n - 2; i >= 0; i--)
{
// ideme umiestnit v[i] tam dozadu kde ma byt
int siz = n - 1 - i;
vector<int> v2 = v;
v2.erase(v2.begin() + i);
v2.push_back(v[i]);
int b = publish(v2);
int sub = (a + b - siz) / 2;
a -= sub;
b -= sub;
v.insert(v.begin() + i + a + 1, v[i]);
v.erase(v.begin() + i);
a = sub;
}
answer(v);
}
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... |