# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
98314 | someone_aa | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++17 | 151 ms | 165084 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>
#define ll long long
#define pb push_back
#define mp make_pair
using namespace std;
const int maxn = 410;
const int inf = 100000000;
int dp[maxn][maxn][maxn][3];
int n, arr[maxn], pref[maxn][3];
string code;
vector<int>v[3];
int main() {
ios_base::sync_with_stdio(false);
cin.tie(0);
cin>>n;
cin>>code;
for(int i=0;i<code.length();i++) {
if(code[i] == 'R') arr[i + 1] = 0;
else if(code[i] == 'G') arr[i + 1] = 1;
else arr[i + 1] = 2;
v[arr[i+1]].pb(i + 1);
for(int j=0;j<=2;j++) {
pref[i+1][j] = pref[i][j];
}
pref[i+1][arr[i+1]]++;
}
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... |