Submission #99003

# Submission time Handle Problem Language Result Execution time Memory
99003 2019-02-28T05:08:33 Z kriii Bitaro the Brave (JOI19_ho_t1) C++17
100 / 100
164 ms 80488 KB
#include <stdio.h>

int H,W; char S[3030][3030]; int A[3030][3030],B[3030][3030];

int main()
{
	scanf ("%d %d",&H,&W);
	for (int i=0;i<H;i++) scanf ("%s",S[i]);

	long long ans = 0;
	for (int i=H-1;i>=0;i--) for (int j=W-1;j>=0;j--){
		A[i][j] = A[i+1][j];
		B[i][j] = B[i][j+1];
		if (S[i][j] == 'I') A[i][j]++;
		if (S[i][j] == 'O') B[i][j]++;
		if (S[i][j] == 'J') ans += (long long) A[i][j] * B[i][j];
	}

	printf ("%lld\n",ans);

	return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:7:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf ("%d %d",&H,&W);
  ~~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:8:30: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (int i=0;i<H;i++) scanf ("%s",S[i]);
                        ~~~~~~^~~~~~~~~~~
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 4 ms 1536 KB Output is correct
6 Correct 3 ms 1408 KB Output is correct
7 Correct 3 ms 1408 KB Output is correct
8 Correct 3 ms 1408 KB Output is correct
9 Correct 4 ms 1408 KB Output is correct
10 Correct 3 ms 1408 KB Output is correct
11 Correct 3 ms 1536 KB Output is correct
12 Correct 3 ms 1408 KB Output is correct
13 Correct 3 ms 1408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 4 ms 1536 KB Output is correct
6 Correct 3 ms 1408 KB Output is correct
7 Correct 3 ms 1408 KB Output is correct
8 Correct 3 ms 1408 KB Output is correct
9 Correct 4 ms 1408 KB Output is correct
10 Correct 3 ms 1408 KB Output is correct
11 Correct 3 ms 1536 KB Output is correct
12 Correct 3 ms 1408 KB Output is correct
13 Correct 3 ms 1408 KB Output is correct
14 Correct 12 ms 7296 KB Output is correct
15 Correct 7 ms 4940 KB Output is correct
16 Correct 6 ms 4144 KB Output is correct
17 Correct 3 ms 512 KB Output is correct
18 Correct 12 ms 7680 KB Output is correct
19 Correct 13 ms 7680 KB Output is correct
20 Correct 11 ms 7680 KB Output is correct
21 Correct 11 ms 7808 KB Output is correct
22 Correct 9 ms 7680 KB Output is correct
23 Correct 12 ms 7552 KB Output is correct
24 Correct 11 ms 7780 KB Output is correct
25 Correct 11 ms 7680 KB Output is correct
26 Correct 13 ms 7552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 3 ms 384 KB Output is correct
3 Correct 2 ms 384 KB Output is correct
4 Correct 2 ms 512 KB Output is correct
5 Correct 4 ms 1536 KB Output is correct
6 Correct 3 ms 1408 KB Output is correct
7 Correct 3 ms 1408 KB Output is correct
8 Correct 3 ms 1408 KB Output is correct
9 Correct 4 ms 1408 KB Output is correct
10 Correct 3 ms 1408 KB Output is correct
11 Correct 3 ms 1536 KB Output is correct
12 Correct 3 ms 1408 KB Output is correct
13 Correct 3 ms 1408 KB Output is correct
14 Correct 12 ms 7296 KB Output is correct
15 Correct 7 ms 4940 KB Output is correct
16 Correct 6 ms 4144 KB Output is correct
17 Correct 3 ms 512 KB Output is correct
18 Correct 12 ms 7680 KB Output is correct
19 Correct 13 ms 7680 KB Output is correct
20 Correct 11 ms 7680 KB Output is correct
21 Correct 11 ms 7808 KB Output is correct
22 Correct 9 ms 7680 KB Output is correct
23 Correct 12 ms 7552 KB Output is correct
24 Correct 11 ms 7780 KB Output is correct
25 Correct 11 ms 7680 KB Output is correct
26 Correct 13 ms 7552 KB Output is correct
27 Correct 160 ms 80488 KB Output is correct
28 Correct 24 ms 25984 KB Output is correct
29 Correct 10 ms 7296 KB Output is correct
30 Correct 3 ms 640 KB Output is correct
31 Correct 121 ms 67164 KB Output is correct
32 Correct 110 ms 80320 KB Output is correct
33 Correct 110 ms 80092 KB Output is correct
34 Correct 137 ms 77688 KB Output is correct
35 Correct 114 ms 80276 KB Output is correct
36 Correct 107 ms 80120 KB Output is correct
37 Correct 164 ms 80456 KB Output is correct
38 Correct 85 ms 67064 KB Output is correct
39 Correct 89 ms 66936 KB Output is correct