# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
720163 | gagik_2007 | Art Collections (BOI22_art) | C++17 | 1686 ms | 664 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 <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cmath>
#include <chrono>
#include <ctime>
#include <set>
#include <map>
#include <stack>
#include <queue>
#include <deque>
#include <limits>
#include <iomanip>
#include <unordered_set>
#include <unordered_map>
#include <fstream>
#include <functional>
#include <random>
#include <cassert>
using namespace std;
typedef long long ll;
typedef long double ld;
#define ff first
#define ss second
ll ttt;
const ll INF = 1e18;
const ll MOD = 1e9 + 7;
const ll N = 1000007;
ll n, m, k;
void solve(int NN) {
n = NN;
vector<int>p;
for (int i = 1; i <= n; i++) {
p.push_back(i);
}
vector<int>ans(n, -1);
int lst = publish(p);
int cur = n;
for (int i = 1; i < n; i++) {
p.insert(p.begin(), p.back());
p.pop_back();
int vl = publish(p);
int x = lst - vl;
ans[(x + n - 1) / 2] = cur;
cur--;
lst = vl;
}
reverse(ans.begin(), ans.end());
for (int i = 0; i < ans.size(); i++) {
if (ans[i] == -1) {
ans[i] = cur;
break;
}
}
answer(ans);
}
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... |