Submission #950851

# Submission time Handle Problem Language Result Execution time Memory
950851 2024-03-20T19:40:52 Z ace5 Dango Maker (JOI18_dango_maker) C++17
100 / 100
82 ms 18028 KB
#include <cstdio>
char a[3001][3001];
bool u[3001][3001];
int ans = 0;
int main(){
    int n,m;
    scanf("%d%d",&n,&m);
    for(int i = 0;i < n;++i)scanf("%s",a[i]);
    for(int i = 0;i < n;++i)
        for(int j = 0;j < m;++j){
            if(a[i][j]!='R')continue;
            if(j<m-2&&a[i][j+1]=='G'&&a[i][j+2]=='W'&&!(u[i][j+1]+u[i][j+2]))ans++;
            else if(i<n-2&&a[i+1][j]=='G'&&a[i+2][j]=='W'){
                if(j>0&&j<m-1&&a[i+1][j-1]=='R'&&a[i+1][j+1]=='W'&&!u[i+1][j+1])u[i+1][j]=1;
                else u[i+2][j]=1;
                ans++;
            }
        }
    printf("%d",ans);
}

Compilation message

dango_maker.cpp: In function 'int main()':
dango_maker.cpp:7:10: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    7 |     scanf("%d%d",&n,&m);
      |     ~~~~~^~~~~~~~~~~~~~
dango_maker.cpp:8:34: warning: ignoring return value of 'int scanf(const char*, ...)' declared with attribute 'warn_unused_result' [-Wunused-result]
    8 |     for(int i = 0;i < n;++i)scanf("%s",a[i]);
      |                             ~~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 0 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2468 KB Output is correct
8 Correct 1 ms 2396 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 0 ms 2396 KB Output is correct
12 Correct 1 ms 2396 KB Output is correct
13 Correct 0 ms 2396 KB Output is correct
14 Correct 1 ms 2396 KB Output is correct
15 Correct 1 ms 2396 KB Output is correct
16 Correct 0 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 0 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2468 KB Output is correct
8 Correct 1 ms 2396 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 0 ms 2396 KB Output is correct
12 Correct 1 ms 2396 KB Output is correct
13 Correct 0 ms 2396 KB Output is correct
14 Correct 1 ms 2396 KB Output is correct
15 Correct 1 ms 2396 KB Output is correct
16 Correct 0 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Correct 0 ms 2448 KB Output is correct
19 Correct 0 ms 2396 KB Output is correct
20 Correct 1 ms 2396 KB Output is correct
21 Correct 0 ms 2396 KB Output is correct
22 Correct 1 ms 2396 KB Output is correct
23 Correct 0 ms 2396 KB Output is correct
24 Correct 1 ms 2396 KB Output is correct
25 Correct 1 ms 2396 KB Output is correct
26 Correct 1 ms 2396 KB Output is correct
27 Correct 0 ms 2396 KB Output is correct
28 Correct 1 ms 2396 KB Output is correct
29 Correct 0 ms 2396 KB Output is correct
30 Correct 0 ms 2396 KB Output is correct
31 Correct 0 ms 2396 KB Output is correct
32 Correct 0 ms 2396 KB Output is correct
33 Correct 1 ms 2396 KB Output is correct
34 Correct 0 ms 2396 KB Output is correct
35 Correct 0 ms 2396 KB Output is correct
36 Correct 0 ms 2396 KB Output is correct
37 Correct 0 ms 2396 KB Output is correct
38 Correct 0 ms 2392 KB Output is correct
39 Correct 1 ms 2396 KB Output is correct
40 Correct 0 ms 2396 KB Output is correct
41 Correct 1 ms 2396 KB Output is correct
42 Correct 0 ms 2396 KB Output is correct
43 Correct 1 ms 2392 KB Output is correct
44 Correct 0 ms 2648 KB Output is correct
45 Correct 1 ms 2392 KB Output is correct
46 Correct 0 ms 2396 KB Output is correct
47 Correct 1 ms 2396 KB Output is correct
48 Correct 0 ms 2396 KB Output is correct
49 Correct 1 ms 2396 KB Output is correct
50 Correct 1 ms 2396 KB Output is correct
51 Correct 0 ms 2396 KB Output is correct
52 Correct 1 ms 2396 KB Output is correct
53 Correct 1 ms 2396 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 1 ms 2392 KB Output is correct
2 Correct 1 ms 2396 KB Output is correct
3 Correct 0 ms 2396 KB Output is correct
4 Correct 1 ms 2396 KB Output is correct
5 Correct 1 ms 2396 KB Output is correct
6 Correct 1 ms 2396 KB Output is correct
7 Correct 1 ms 2468 KB Output is correct
8 Correct 1 ms 2396 KB Output is correct
9 Correct 0 ms 2396 KB Output is correct
10 Correct 1 ms 2396 KB Output is correct
11 Correct 0 ms 2396 KB Output is correct
12 Correct 1 ms 2396 KB Output is correct
13 Correct 0 ms 2396 KB Output is correct
14 Correct 1 ms 2396 KB Output is correct
15 Correct 1 ms 2396 KB Output is correct
16 Correct 0 ms 2396 KB Output is correct
17 Correct 1 ms 2396 KB Output is correct
18 Correct 0 ms 2448 KB Output is correct
19 Correct 0 ms 2396 KB Output is correct
20 Correct 1 ms 2396 KB Output is correct
21 Correct 0 ms 2396 KB Output is correct
22 Correct 1 ms 2396 KB Output is correct
23 Correct 0 ms 2396 KB Output is correct
24 Correct 1 ms 2396 KB Output is correct
25 Correct 1 ms 2396 KB Output is correct
26 Correct 1 ms 2396 KB Output is correct
27 Correct 0 ms 2396 KB Output is correct
28 Correct 1 ms 2396 KB Output is correct
29 Correct 0 ms 2396 KB Output is correct
30 Correct 0 ms 2396 KB Output is correct
31 Correct 0 ms 2396 KB Output is correct
32 Correct 0 ms 2396 KB Output is correct
33 Correct 1 ms 2396 KB Output is correct
34 Correct 0 ms 2396 KB Output is correct
35 Correct 0 ms 2396 KB Output is correct
36 Correct 0 ms 2396 KB Output is correct
37 Correct 0 ms 2396 KB Output is correct
38 Correct 0 ms 2392 KB Output is correct
39 Correct 1 ms 2396 KB Output is correct
40 Correct 0 ms 2396 KB Output is correct
41 Correct 1 ms 2396 KB Output is correct
42 Correct 0 ms 2396 KB Output is correct
43 Correct 1 ms 2392 KB Output is correct
44 Correct 0 ms 2648 KB Output is correct
45 Correct 1 ms 2392 KB Output is correct
46 Correct 0 ms 2396 KB Output is correct
47 Correct 1 ms 2396 KB Output is correct
48 Correct 0 ms 2396 KB Output is correct
49 Correct 1 ms 2396 KB Output is correct
50 Correct 1 ms 2396 KB Output is correct
51 Correct 0 ms 2396 KB Output is correct
52 Correct 1 ms 2396 KB Output is correct
53 Correct 1 ms 2396 KB Output is correct
54 Correct 1 ms 2396 KB Output is correct
55 Correct 3 ms 16732 KB Output is correct
56 Correct 1 ms 2396 KB Output is correct
57 Correct 2 ms 15452 KB Output is correct
58 Correct 10 ms 9564 KB Output is correct
59 Correct 76 ms 18000 KB Output is correct
60 Correct 80 ms 18020 KB Output is correct
61 Correct 82 ms 18028 KB Output is correct
62 Correct 1 ms 2404 KB Output is correct
63 Correct 76 ms 18016 KB Output is correct
64 Correct 52 ms 17996 KB Output is correct
65 Correct 40 ms 18000 KB Output is correct
66 Correct 55 ms 18004 KB Output is correct
67 Correct 36 ms 17792 KB Output is correct
68 Correct 36 ms 17696 KB Output is correct
69 Correct 40 ms 17744 KB Output is correct
70 Correct 5 ms 9560 KB Output is correct
71 Correct 6 ms 9564 KB Output is correct
72 Correct 8 ms 9564 KB Output is correct
73 Correct 6 ms 9644 KB Output is correct
74 Correct 6 ms 9560 KB Output is correct
75 Correct 6 ms 9564 KB Output is correct
76 Correct 6 ms 9564 KB Output is correct
77 Correct 8 ms 9564 KB Output is correct
78 Correct 6 ms 9564 KB Output is correct
79 Correct 9 ms 9652 KB Output is correct
80 Correct 8 ms 9820 KB Output is correct
81 Correct 6 ms 9560 KB Output is correct
82 Correct 6 ms 9652 KB Output is correct
83 Correct 10 ms 9564 KB Output is correct
84 Correct 6 ms 9772 KB Output is correct
85 Correct 6 ms 9564 KB Output is correct
86 Correct 7 ms 9572 KB Output is correct
87 Correct 6 ms 9564 KB Output is correct
88 Correct 6 ms 9560 KB Output is correct
89 Correct 7 ms 9652 KB Output is correct
90 Correct 6 ms 9564 KB Output is correct