# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
790621 | tvladm2009 | Cake 3 (JOI19_cake3) | C++17 | 4048 ms | 8128 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>
using namespace std;
typedef long long ll;
/**const int INF = (int) 1e9;
vector<int> v;
void run(int lvl = 0) {
if (lvl == 4) {
vector<int> cv = v;
sort(cv.begin(), cv.end());
int best = INF;
while (next_permutation(cv.begin(), cv.end())) {
int now = 0;
for (int i = 1; i < (int) cv.size(); i++) {
now += abs(cv[i] - cv[i - 1]);
}
now += abs(cv.back() - cv[0]);
if (now < best) {
best = now;
}
}
cv = v;
sort(cv.begin(), cv.end());
cout << "[";
for (int i = 0; i < (int) v.size(); i++) {
cout << v[i];
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |