Submission #559933

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
5599332022-05-11 01:19:32Notred132Growing Vegetable is Fun 3 (JOI19_ho_t3)C++17
100 / 100
485 ms769880 KiB
#include <iostream>
using namespace std;
const int maxn = 405;
int n;
char a[maxn];
int f[maxn][3][maxn][maxn];
int x[3][maxn];
int cnt[3];
int g[3][maxn][3];
int main()
{
ios_base::sync_with_stdio(NULL); cin.tie(nullptr);
cin >> n;
for(int i = 1; i <= n; ++i) cin >> a[i];
for(int i = 1; i <= n; ++i) {
if(a[i] == 'R') {
x[0][++cnt[0]] = i;
g[0][cnt[0]][1] = cnt[1];
g[0][cnt[0]][2] = cnt[2];
}
else if(a[i] == 'G') {
x[1][++cnt[1]] = i;
g[1][cnt[1]][0] = cnt[0];
g[1][cnt[1]][2] = cnt[2];
}
else {
x[2][++cnt[2]] = i;
g[2][cnt[2]][0] = cnt[0];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...