# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
263585 | keko37 | Minerals (JOI19_minerals) | C++14 | 73 ms | 4124 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 "minerals.h"
using namespace std;
typedef vector <int> vi;
const int MAXN = 45000;
int n, prosli = 0;
int dp[MAXN], opt[MAXN];
int calc (int len) {
if (dp[len] != -1) return dp[len];
if (len == 1) return dp[len] = 0;
int res = 1e9;
int x = (double) len / 2.618;
for (int j = 0; j <= 1; j++) {
int i = x + j;
if (i < 1 || i >= len) continue;
int tmp = min(i, len - i) + len - 1 + calc(i) + calc(len - i);
if (tmp < res) {
res = tmp;
opt[len] = i;
}
}
return dp[len] = res;
}
bool pitaj (int x) {
# | 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... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |