# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
427957 | Berted | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++14 | 257 ms | 7956 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>
#define ll long long
using namespace std;
const ll INF = 1e18;
int N; string S;
vector<int> A[3];
ll DP[2][3][401][401];
int main()
{
cin >> N >> S;
for (int i = 1; i <= N; i++)
{
if (S[i - 1] == 'R') {A[0].push_back(i);}
else if (S[i - 1] == 'G') {A[1].push_back(i);}
else {A[2].push_back(i);}
}
for (int s = 0; s < 3; s++)
for (int i = 0; i <= N; i++)
for (int j = 0; j <= N; j++) DP[0][s][i][j] = INF;
for (int s = 0; s < 3; s++) DP[0][s][0][0] = 0;
for (int i = 1; i <= N; i++)
{
for (int s = 0; s < 3; s++)
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... |