Submission #97610

# Submission time Handle Problem Language Result Execution time Memory
97610 2019-02-17T13:10:30 Z maruii Bitaro the Brave (JOI19_ho_t1) C++14
100 / 100
129 ms 79708 KB
#include <bits/stdc++.h>
using namespace std;
char s[3005][3005];
int H, W, O[3005][3005], I[3005][3005];
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)
			O[i][j] = O[i][j+1]+(s[i][j]=='O'), I[i][j] = I[i+1][j]+(s[i][j]=='I'), ans += (s[i][j]=='J')*O[i][j]*I[i][j];
	printf("%lld",ans);
	return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:6:7: 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:7: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 356 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 4 ms 1536 KB Output is correct
6 Correct 3 ms 1536 KB Output is correct
7 Correct 3 ms 1408 KB Output is correct
8 Correct 3 ms 1536 KB Output is correct
9 Correct 3 ms 1536 KB Output is correct
10 Correct 1 ms 1408 KB Output is correct
11 Correct 3 ms 1536 KB Output is correct
12 Correct 4 ms 1536 KB Output is correct
13 Correct 3 ms 1408 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 356 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 4 ms 1536 KB Output is correct
6 Correct 3 ms 1536 KB Output is correct
7 Correct 3 ms 1408 KB Output is correct
8 Correct 3 ms 1536 KB Output is correct
9 Correct 3 ms 1536 KB Output is correct
10 Correct 1 ms 1408 KB Output is correct
11 Correct 3 ms 1536 KB Output is correct
12 Correct 4 ms 1536 KB Output is correct
13 Correct 3 ms 1408 KB Output is correct
14 Correct 9 ms 7296 KB Output is correct
15 Correct 6 ms 4992 KB Output is correct
16 Correct 7 ms 4224 KB Output is correct
17 Correct 3 ms 512 KB Output is correct
18 Correct 11 ms 7680 KB Output is correct
19 Correct 10 ms 7680 KB Output is correct
20 Correct 11 ms 7552 KB Output is correct
21 Correct 11 ms 7808 KB Output is correct
22 Correct 9 ms 7680 KB Output is correct
23 Correct 10 ms 7552 KB Output is correct
24 Correct 10 ms 7808 KB Output is correct
25 Correct 11 ms 7680 KB Output is correct
26 Correct 12 ms 7552 KB Output is correct
# Verdict Execution time Memory Grader output
1 Correct 2 ms 356 KB Output is correct
2 Correct 2 ms 384 KB Output is correct
3 Correct 3 ms 384 KB Output is correct
4 Correct 2 ms 384 KB Output is correct
5 Correct 4 ms 1536 KB Output is correct
6 Correct 3 ms 1536 KB Output is correct
7 Correct 3 ms 1408 KB Output is correct
8 Correct 3 ms 1536 KB Output is correct
9 Correct 3 ms 1536 KB Output is correct
10 Correct 1 ms 1408 KB Output is correct
11 Correct 3 ms 1536 KB Output is correct
12 Correct 4 ms 1536 KB Output is correct
13 Correct 3 ms 1408 KB Output is correct
14 Correct 9 ms 7296 KB Output is correct
15 Correct 6 ms 4992 KB Output is correct
16 Correct 7 ms 4224 KB Output is correct
17 Correct 3 ms 512 KB Output is correct
18 Correct 11 ms 7680 KB Output is correct
19 Correct 10 ms 7680 KB Output is correct
20 Correct 11 ms 7552 KB Output is correct
21 Correct 11 ms 7808 KB Output is correct
22 Correct 9 ms 7680 KB Output is correct
23 Correct 10 ms 7552 KB Output is correct
24 Correct 10 ms 7808 KB Output is correct
25 Correct 11 ms 7680 KB Output is correct
26 Correct 12 ms 7552 KB Output is correct
27 Correct 112 ms 79668 KB Output is correct
28 Correct 27 ms 26008 KB Output is correct
29 Correct 13 ms 7168 KB Output is correct
30 Correct 3 ms 640 KB Output is correct
31 Correct 81 ms 66524 KB Output is correct
32 Correct 129 ms 79708 KB Output is correct
33 Correct 129 ms 79452 KB Output is correct
34 Correct 103 ms 77084 KB Output is correct
35 Correct 101 ms 79708 KB Output is correct
36 Correct 110 ms 79480 KB Output is correct
37 Correct 104 ms 79708 KB Output is correct
38 Correct 84 ms 66524 KB Output is correct
39 Correct 96 ms 66296 KB Output is correct