# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
968893 | Pwo | Art Collections (BOI22_art) | C++17 | 1223 ms | 1692 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"
using namespace std;
typedef long long ll;
void solve(int N) {
pair<int, int> a[N];
vector<int> v(N, 0);
for (int i = 0; i < N; i++) v[i] = i + 1;
for (int i = 0; i < N; i++) {
int u = publish(v);
a[i] = {u, i + 1};
rotate(v.begin(), v.begin() + 1, v.end());
}
int tmp = a[0].first;
for (int i = 0; i < N - 1; i++)
a[i].first = a[i + 1].first - a[i].first;
a[N - 1].first = tmp - a[N - 1].first;
sort(a, a + N);
vector<int> ans;
for (int i = N - 1; i >= 0; i--) ans.push_back(a[i].second);
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... |