Submission #780718

#TimeUsernameProblemLanguageResultExecution timeMemory
780718Trisanu_DasDango Maker (JOI18_dango_maker)C++17
Compilation error
0 ms0 KiB
#include <bits/stdc++.h> using namespace std; typedef long long ll; typedef pair<int, int> pii; typedef pair<ll, ll> pll; const int MAXN = 3000; int N, M; char A[MAXN+10][MAXN+10]; int dp[MAXN+10][3], ans; int main() { int i, j; cin >> N >> M for(i=1; i<=N; i++) scanf("%s", A[i]+1); for(i=2; i<=N+M; i++) { int s=max(1, i-N), e=min(M, i-1); memset(dp, 0, sizeof(dp)); for(j=s; j<=e; j++) { int x=j, y=i-j; dp[x][0]=max(dp[x-1][0], max(dp[x-1][1], dp[x-1][2])); if(A[y-1][x]=='R' && A[y][x]=='G' && A[y+1][x]=='W') dp[x][1]=max(dp[x-1][0], dp[x-1][1])+1; if(A[y][x-1]=='R' && A[y][x]=='G' && A[y][x+1]=='W') dp[x][2]=max(dp[x-1][0], dp[x-1][2])+1; } ans+=max(dp[e][0], max(dp[e][1], dp[e][2])); } cout << ans << '\n'; }

Compilation message (stderr)

dango_maker.cpp: In function 'int main()':
dango_maker.cpp:18:18: error: expected ';' before 'for'
   18 |     cin >> N >> M
      |                  ^
      |                  ;
   19 |     for(i=1; i<=N; i++) scanf("%s", A[i]+1);
      |     ~~~           
dango_maker.cpp:19:15: warning: statement has no effect [-Wunused-value]
   19 |     for(i=1; i<=N; i++) scanf("%s", A[i]+1);
      |              ~^~~
dango_maker.cpp:19:23: error: expected ';' before ')' token
   19 |     for(i=1; i<=N; i++) scanf("%s", A[i]+1);
      |                       ^
      |                       ;