# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
125707 | 2019-07-06T09:12:11 Z | youngyojun | Dango Maker (JOI18_dango_maker) | C++11 | 2 ms | 376 KB |
#include <bits/stdc++.h> #define upmax(a,b) (a)=max((a),(b)) using namespace std; char A[3005][3005]; int D[3005][2]; int H, W, Ans; int main() { scanf("%d%d", &H, &W); for(int i = 1; i <= H; i++) scanf(" %s", A[i]+1); for(int sum = 3; sum < H+W; sum++) { int ret = 0; for(int y = 1, x = sum-1; y <= H; y++, x--) { if(x < 1) break; if(W < x) continue; D[y][0] = D[y][1] = max(D[y+1][0], D[y+1][1]); D[y+1][0] = D[y+1][1] = 0; if('G' != A[y][x]) continue; if('R' == A[y][x-1] && 'W' == A[y][x+1]) upmax(D[y][0], D[y+1][0]+1); if('R' == A[y-1][x] && 'W' == A[y+1][x]) upmax(D[y][1], D[y+1][1]+1); upmax(ret, max(D[y][0], D[y][1])); } Ans += ret; } cout << Ans << endl; return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Incorrect | 2 ms | 376 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Incorrect | 2 ms | 376 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 376 KB | Output is correct |
2 | Correct | 2 ms | 376 KB | Output is correct |
3 | Correct | 2 ms | 376 KB | Output is correct |
4 | Correct | 2 ms | 376 KB | Output is correct |
5 | Correct | 2 ms | 376 KB | Output is correct |
6 | Incorrect | 2 ms | 376 KB | Output isn't correct |
7 | Halted | 0 ms | 0 KB | - |