# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
642043 | valerikk | Candies (JOI18_candies) | C++17 | 5062 ms | 26004 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 <iostream>
#include <vector>
#include <cassert>
#include <algorithm>
using namespace std;
typedef long long ll;
const ll INF = 2e18;
int main() {
ios::sync_with_stdio(false);
cin.tie(0);
int n;
cin >> n;
vector<ll> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
vector dp(n + 1, vector<ll>(2, -INF));
dp[0][0] = 0;
for (int i = 0; i < n; ++i) {
vector ndp(n + 1, vector<ll>(2, -INF));
for (int j = 0; j <= n; ++j) {
for (int f = 0; f < 2; ++f) {
if (dp[j][f] == -INF) continue;
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |