| # | Time | Username | Problem | Language | Result | Execution time | Memory |
|---|---|---|---|---|---|---|---|
| 673875 | gesgha | Art Collections (BOI22_art) | C++17 | 1528 ms | 736 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 <bits/stdc++.h>
#include "art.h"
#define fr(i, a, b) for (int i = a; i <= b; ++i)
#define rf(i, a, b) for (int i = a; i >= b; --i)
#define fe(x, y) for (auto& x : y)
#define fi first
#define se second
#define pb push_back
#define sz(x) (int)x.size()
#define all(x) x.begin(), x.end()
#define pw(x) (1LL << (x))
using namespace std;
template <typename T>
using ve = vector < T >;
template <typename T>
bool umx(T& a, T b) {return a < b ? a = b, 1 : 0;}
template <typename T>
bool umn(T& a, T b) {return a > b ? a = b, 1 : 0;}
using ll = long long;
using pll = pair <ll, ll>;
using pii = pair <int, int>;
const int N = 2e5 + 100;
const int oo = 1e9 + 10;
const ll OO = 1e18 + 100;
vector<int> order;
int n;
int ans[N];
void solve(int k) {
n = k;
order.resize(n, 0);
iota(all(order), 1);
int was = publish(order);
int last = was;
for (int i = 0; i < n; ++i) {
int x = was;
order.erase(order.begin());
order.pb(i + 1);
int y = last;
if (i != n - 1) y = publish(order);
int vl = (x + y - (n - 1)) / 2;
ans[x - vl] = i;
was = y;
}
order.clear();
fr(i, 0, n - 1) order.pb(ans[i] + 1);
answer(order);
}
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... | ||||
