# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
993646 | yellowtoad | Art Collections (BOI22_art) | C++17 | 1156 ms | 1636 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 <vector>
using namespace std;
void solve(int n) {
vector<int> a(n);
for (int i = 0; i < n; i++) a[i] = i+1;
int cur = publish(a);
for (int i = 1; i < n; i++) {
for (int j = i-1; j >= 0; j--) a[j+1] = a[j];
a[0] = i+1;
int x = publish(a);
for (int j = 0; j < (i+x-cur)/2; j++) a[j] = a[j+1];
a[(i+x-cur)/2] = i+1;
cur = x-(i+x-cur)/2;
}
answer(a);
}
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... |