# | 제출 시각UTC-0 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
60771 | gusfring | Dango Maker (JOI18_dango_maker) | C++14 | 1223 ms | 238604 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
const int N = 3005;
int n, m, d[N][N][4], r;
char a[N][N];
int v(int x, int y, int d){
return
a[x][y] == 'R' &&
a[x + d][y + !d] == 'G' &&
a[x + 2 * d][y + 2 * !d] == 'W';
}
int main(){
cin >> n >> m;
for(int i = 1; i <= n; i++) for(int j = 1; j <= m; j++) cin >> a[i][j];
for(int t = 2; t <= n + m; t++){
int cm = 0;
for(int i = t - 1, j; i >= 1; i--){
j = t - i;
if(j < 1 || j > m || i < 1 || i > n) continue;
int *c = d[i][j], *p = d[i + 1][j - 1];
c[0] = max(p[0] + v(i, j, 1), p[1]);
c[1] = max(p[2], p[3]);
if(v(i, j, 0)){
c[2] = max(p[0], p[1]) + 1;
c[3] = max(p[2], p[3]) + 1;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |