# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
224233 | 2020-04-17T14:45:21 Z | Ruxandra985 | Dango Maker (JOI18_dango_maker) | C++14 | 5 ms | 384 KB |
#include <bits/stdc++.h> using namespace std; char a[3010][3010]; int f[3010][3010] , vert , oriz , n , m , sol; int main() { FILE *fin = stdin; FILE *fout = stdout; int i , j; fscanf (fin,"%d%d\n",&n,&m); for (i = 1 ; i <= n ; i++) fgets(a[i] + 1 , m + 10 , fin); for (i = 1 ; i <= n ; i++){ for (j = 1 ; j <= m ; j++){ if (a[i][j] == 'W'){ if (i >= 3 && a[i - 1][j] == 'G' && a[i - 2][j] == 'R') f[i][j] = max(f[i][j] , 1 + f[i - 3][j] + f[i][j - 1] - f[i - 3][j - 1]); if (j >= 3 && a[i][j - 1] == 'G' && a[i][j - 2] == 'R') f[i][j] = max(f[i][j] , 1 + f[i][j - 3] + f[i - 1][j] - f[i - 1][j - 3]); f[i][j] = max(f[i][j] , f[i - 1][j] + f[i][j - 1] - f[i - 1][j - 1]); } else f[i][j] = f[i - 1][j] + f[i][j - 1] - f[i - 1][j - 1]; } } fprintf (fout,"%d",f[n][m]); return 0; }
Compilation message
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 4 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Incorrect | 5 ms | 384 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 4 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Incorrect | 5 ms | 384 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |
# | 결과 | 실행 시간 | 메모리 | Grader output |
---|---|---|---|---|
1 | Correct | 5 ms | 384 KB | Output is correct |
2 | Correct | 5 ms | 384 KB | Output is correct |
3 | Correct | 4 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 5 ms | 384 KB | Output is correct |
6 | Correct | 5 ms | 384 KB | Output is correct |
7 | Correct | 5 ms | 384 KB | Output is correct |
8 | Incorrect | 5 ms | 384 KB | Output isn't correct |
9 | Halted | 0 ms | 0 KB | - |