# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
99089 | gs14004 | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++17 | 386 ms | 171772 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;
const int MAXN = 405;
using lint = long long;
using pi = pair<int, int>;
int n;
char str[MAXN];
int dp[222][222][222][4];
vector<int> rep[3];
int sum[3][MAXN];
int cntAfter(char arg, int pos){
if(arg == 'R') return sum[0][pos + 1];
if(arg == 'G') return sum[1][pos + 1];
if(arg == 'Y') return sum[2][pos + 1];
assert(0);
}
int cost(int cR, int cG, int cY, int mode){
int pos = -1;
if(mode == 0) pos = rep[mode][cR-1];
if(mode == 1) pos = rep[mode][cG-1];
if(mode == 2) pos = rep[mode][cY-1];
return
max(cntAfter('R', pos) - cR, 0) +
max(cntAfter('G', pos) - cG, 0) +
max(cntAfter('Y', pos) - cY, 0);
}
# | 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... |