제출 #848930

#제출 시각UTC-0아이디문제언어결과실행 시간메모리
8489302023-09-13 18:00:22qthang2k11Growing Vegetable is Fun 3 (JOI19_ho_t3)C++17
100 / 100
140 ms774744 KiB
#include <bits/stdc++.h>
using namespace std;
template<class X, class Y>
inline void mini(X &x, Y y) {
if (x > y) x = y;
}
const int N = 404;
int sum[N][3], dp[N][N][N][3];
vector<int> pos[3];
string s;
int n;
inline int get(int c, int l, int r) {
return sum[r][c] - sum[l - 1][c];
}
int32_t main() {
cin.tie(0)->sync_with_stdio(0);
map<char, int> mp;
mp['R'] = 0;
mp['G'] = 1;
mp['Y'] = 2;
cin >> n >> s;
for (int i = 1; i <= n; i++) {
int val = mp[s[i - 1]];
for (int j = 0; j < 3; j++)
sum[i][j] = sum[i - 1][j];
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
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...