제출 #125708

#제출 시각아이디문제언어결과실행 시간메모리
125708youngyojunDango Maker (JOI18_dango_maker)C++11
0 / 100
4 ms376 KiB
#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; memset(D[0], 0, 3005*2*4); 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]); 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; }

컴파일 시 표준 에러 (stderr) 메시지

dango_maker.cpp: In function 'int main()':
dango_maker.cpp:19:4: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
    if(x < 1) break; if(W < x) continue;
    ^~
dango_maker.cpp:19:21: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
    if(x < 1) break; if(W < x) continue;
                     ^~
dango_maker.cpp:12:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d", &H, &W);
  ~~~~~^~~~~~~~~~~~~~~~
dango_maker.cpp:13:35: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for(int i = 1; i <= H; i++) scanf(" %s", A[i]+1);
                              ~~~~~^~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...