# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
647676 | Ronin13 | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++14 | 453 ms | 757564 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 ull unsigned ll
#define f first
#define s second
#define pii pair<int,int>
#define pll pair<ll,ll>
#define pb push_back
#define epb emplace_back
using namespace std;
int pref[401][3];
int dp[401][401][401][3];
vector <int> vec[3];
int main(){
int n; cin >> n;
char c[n + 1];
for(int i = 1; i <= n;i ++) cin >> c[i];
for(int i = 1; i <= n; i++){
for(int j = 0; j < 3; j++) pref[i][j] = pref[i - 1][j];
if(c[i] == 'R')
pref[i][0]++, vec[0].pb(i);
if(c[i] == 'G')
pref[i][1]++, vec[1].pb(i);
if(c[i] == 'Y')
pref[i][2]++, vec[2].pb(i);
}
for(int i = 0; i <= n; i++){
# | 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... |