# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
108782 | 2019-05-02T00:40:31 Z | thebes | Dango Maker (JOI18_dango_maker) | C++14 | 4 ms | 512 KB |
#include <bits/stdc++.h> using namespace std; const int MN = 3005; int a[MN][MN], n, m, i, j, ans; int main(){ for(scanf("%d%d",&n,&m),i=1;i<=n;i++){ for(getchar(),j=1;j<=m;j++){ char ch = getchar(); if(ch=='G') a[i][j]=1; else if(ch=='W') a[i][j]=2; } } for(i=1;i<=n;i++){ for(j=1;j<=m;j++){ if(j+2<=m){ if(a[i][j]==0&&a[i][j+1]==1&&a[i][j+2]==2){ ans++; a[i][j]=a[i][j+1]=a[i][j+2]=-1; } } if(i+2<=n){ if(a[i][j]==0&&a[i+1][j]==1&&a[i+2][j]==2){ ans++; a[i][j]=a[i+1][j]=a[i+2][j]=-1; } } } } printf("%d\n",ans); return 0; }
Compilation message
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 384 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 384 KB | Output is correct |
9 | Correct | 2 ms | 384 KB | Output is correct |
10 | Correct | 3 ms | 384 KB | Output is correct |
11 | Correct | 3 ms | 384 KB | Output is correct |
12 | Correct | 2 ms | 384 KB | Output is correct |
13 | Correct | 3 ms | 384 KB | Output is correct |
14 | Correct | 2 ms | 512 KB | Output is correct |
15 | Correct | 3 ms | 384 KB | Output is correct |
16 | Correct | 2 ms | 384 KB | Output is correct |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 384 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 384 KB | Output is correct |
9 | Correct | 2 ms | 384 KB | Output is correct |
10 | Correct | 3 ms | 384 KB | Output is correct |
11 | Correct | 3 ms | 384 KB | Output is correct |
12 | Correct | 2 ms | 384 KB | Output is correct |
13 | Correct | 3 ms | 384 KB | Output is correct |
14 | Correct | 2 ms | 512 KB | Output is correct |
15 | Correct | 3 ms | 384 KB | Output is correct |
16 | Correct | 2 ms | 384 KB | Output is correct |
17 | Correct | 3 ms | 384 KB | Output is correct |
18 | Correct | 2 ms | 384 KB | Output is correct |
19 | Correct | 2 ms | 384 KB | Output is correct |
20 | Correct | 2 ms | 384 KB | Output is correct |
21 | Correct | 2 ms | 384 KB | Output is correct |
22 | Incorrect | 2 ms | 384 KB | Output isn't correct |
23 | Halted | 0 ms | 0 KB | - |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
1 | Correct | 2 ms | 384 KB | Output is correct |
2 | Correct | 2 ms | 384 KB | Output is correct |
3 | Correct | 2 ms | 384 KB | Output is correct |
4 | Correct | 4 ms | 384 KB | Output is correct |
5 | Correct | 2 ms | 384 KB | Output is correct |
6 | Correct | 2 ms | 384 KB | Output is correct |
7 | Correct | 2 ms | 256 KB | Output is correct |
8 | Correct | 2 ms | 384 KB | Output is correct |
9 | Correct | 2 ms | 384 KB | Output is correct |
10 | Correct | 3 ms | 384 KB | Output is correct |
11 | Correct | 3 ms | 384 KB | Output is correct |
12 | Correct | 2 ms | 384 KB | Output is correct |
13 | Correct | 3 ms | 384 KB | Output is correct |
14 | Correct | 2 ms | 512 KB | Output is correct |
15 | Correct | 3 ms | 384 KB | Output is correct |
16 | Correct | 2 ms | 384 KB | Output is correct |
17 | Correct | 3 ms | 384 KB | Output is correct |
18 | Correct | 2 ms | 384 KB | Output is correct |
19 | Correct | 2 ms | 384 KB | Output is correct |
20 | Correct | 2 ms | 384 KB | Output is correct |
21 | Correct | 2 ms | 384 KB | Output is correct |
22 | Incorrect | 2 ms | 384 KB | Output isn't correct |
23 | Halted | 0 ms | 0 KB | - |