# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
129179 | keko37 | Koala Game (APIO17_koala) | C++14 | 82 ms | 984 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 "koala.h"
using namespace std;
const int MAXN = 105;
int n, w, flg;
int dp[105][105];
int B[MAXN], R[MAXN];
bool f (int ll, int rr, int c) {
vector <int> a, b;
for (int i = n; i >= 1; i--) {
if (ll <= i && i <= rr) {
if (a.empty()) a.push_back(i); else a.push_back(a.back() + i);
} else {
if (b.empty()) b.push_back(i); else b.push_back(b.back() + i);
}
}
vector < pair <int, int> > res;
int mx = -1;
for (int i=0; i<=a.size(); i++) {
for (int j=0; j<=b.size(); j++) {
int cost = i * (c + 1) + j;
int val = 0;
if (i > 0) val += a[i-1];
if (j > 0) val += b[j-1];
if (cost <= w) {
if (val > mx) {
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... |