# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
99752 | MrTEK | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++14 | 148 ms | 163064 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;
typedef long long int ll;
typedef pair<int,int> ii;
const int N = 4e2 + 5;
const int INF = 1e9;
int n,f[3],mpx[300],dp[N][N][N][3];
char s[N];
vector <pair <int,ii>> pos[3];
inline int calc(pair <int,ii> x,pair <int,ii> y) {
return abs(x.first - y.first) + abs(x.second.first - y.second.first) + abs(x.second.second - y.second.second);
}
int main() {
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
mpx['R'] = 0;
mpx['G'] = 1;
mpx['Y'] = 2;
cin >> n >> (s + 1);
for (int i = 1 ; i <= n ; i++) {
f[mpx[s[i]]]++;
pos[mpx[s[i]]].push_back({f[0],{f[1],f[2]}});
}
for (int r = 0 ; r <= f[0] ; r++) {
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... |