# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
928338 | Unforgettablepl | Growing Vegetable is Fun 3 (JOI19_ho_t3) | C++17 | 189 ms | 794924 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define int long long
const int INF = 1e15;
int pref[3][401][401];
int DP[401][401][401][3];
int idx[3][401];
int32_t main(){
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n;
cin >> n;
int red = 0;
int green = 0;
int yellow = 0;
for (int i = 1; i <= n; i ++) {
char a;cin>>a;
if(a=='R'){
idx[0][++red]=i;
for(int j=1;j<=n;j++)pref[0][red][j]=pref[0][red-1][j];
for(int j=i;j<=n;j++)pref[0][red][j]++;
} else if(a=='G'){
idx[1][++green]=i;
for(int j=1;j<=n;j++)pref[1][green][j]=pref[1][green-1][j];
for(int j=i;j<=n;j++)pref[1][green][j]++;
} else {
# | 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... |