# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
101718 | KCSC | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++14 | 170 ms | 163152 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int DIM = 405;
const int INF = 405 * 405;
char str[DIM];
int dp[DIM][DIM][DIM][3], idx[3];
int tot[3], psm[DIM][3], lst[DIM][3];
inline void f(int &x, int y) {
if (x >= y) { x = y; } }
int main(void) {
#ifdef HOME
freopen("vegetables.in", "r", stdin);
freopen("vegetables.out", "w", stdout);
#endif
int n; cin >> n >> (str + 1);
for (int i = 1; i <= n; ++i) {
char ch = str[i];
if (ch == 'R') { lst[++tot[0]][0] = i; ++psm[i][0]; }
if (ch == 'G') { lst[++tot[1]][1] = i; ++psm[i][1]; }
if (ch == 'Y') { lst[++tot[2]][2] = i; ++psm[i][2]; }
for (int l = 0; l <= 2; ++l) {
psm[i][l] += psm[i - 1][l]; } }
for (int a = 0; a <= tot[0]; ++a) {
for (int b = 0; b <= tot[1]; ++b) {
for (int c = 0; c <= tot[2]; ++c) {
for (int l = 0; l <= 2; ++l) {
# | 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... |