# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1093428 | DeathIsAwe | Art Collections (BOI22_art) | C++17 | 1073 ms | 1740 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;
int ans[4001];
bool visited[4001];
void solve(int n) {
for (int i=0;i<4001;i++) {
ans[i] = -1;
visited[i] = false;
}
vector<int> arr(n);
for (int i=0;i<n;i++) {
arr[i] = i + 1;
}
int refnum = publish(arr);
vector<int> newarr(n);
int newrefnum;
for (int i=0;i<n-1;i++) {
for (int j=0;j<n-1;j++) {
newarr[j] = arr[j + 1];
}
newarr[n - 1] = arr[0];
newrefnum = publish(newarr);
ans[(refnum - newrefnum + n - 1) / 2 + 1] = arr[0];
visited[arr[0]] = true;
arr = newarr;
refnum = newrefnum;
}
int lastnum;
for (int i=1;i<n+1;i++) {
if (!visited[i]) {
lastnum = i;
break;
}
}
vector<int> ansarr(n);
for (int i=1;i<n+1;i++) {
if (ans[i] == -1) {
ansarr[i - 1] = lastnum;
} else {
ansarr[i - 1] = ans[i];
}
}
answer(ansarr);
}
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... |