# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
338424 | KoD | Xylophone (JOI18_xylophone) | C++17 | 157 ms | 98540 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>
template <class T>
using Vec = std::vector<T>;
#ifdef __APPLE__
int query(int, int);
void answer(int, int);
#else
#include "xylophone.h"
#endif
void solve(int N) {
Vec<Vec<int>> memo(N, Vec<int>(N, -1));
const auto ask = [&](int s, int t) {
if (memo[s][t] != -1) {
return memo[s][t];
}
return memo[s][t] = query(s + 1, t + 1);
};
const auto fill = [&](Vec<int> &vec) {
for (int i = 2; i < N; ++i) {
const auto a = ask(i - 2, i - 1);
const auto b = ask(i - 1, i);
const auto c = ask(i - 2, i);
if (vec[i - 2] < vec[i - 1]) {
if (a + b == c) {
vec[i] = vec[i - 1] + b;
}
else {
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |