Submission #121037

# Submission time Handle Problem Language Result Execution time Memory
121037 2019-06-26T03:47:04 Z 김현수(#3331) Bitaro the Brave (JOI19_ho_t1) C++14
100 / 100
149 ms 79820 KB
#include<bits/stdc++.h>
using namespace std;

const int N = 3005;

int n, m, x[N][N], y[N][N];
char a[N][N];

long long ans;

int main()
{
	scanf("%d%d",&n,&m);
	for(int i=1;i<=n;i++) {
		scanf("%s", a[i]+1);
		for(int j=m;j>=1;j--) {
			x[i][j] = x[i][j+1] + (a[i][j] == 'O');
			y[i][j] = (a[i][j] == 'I');
		}
	}
	for(int i=n;i>=1;i--) {
		for(int j=1;j<=m;j++) {
			y[i][j] += y[i+1][j];
			if(a[i][j] == 'J') ans += 1ll * x[i][j] * y[i][j];
		}
	}
	printf("%lld\n", ans);
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:13:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%d%d",&n,&m);
  ~~~~~^~~~~~~~~~~~~~
joi2019_ho_t1.cpp:15:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", a[i]+1);
   ~~~~~^~~~~~~~~~~~~~
# 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 2 ms 384 KB Output is correct
5 Correct 3 ms 1536 KB Output is correct
6 Correct 2 ms 1536 KB Output is correct
7 Correct 2 ms 1408 KB Output is correct
8 Correct 3 ms 1508 KB Output is correct
9 Correct 2 ms 1536 KB Output is correct
10 Correct 2 ms 1408 KB Output is correct
11 Correct 3 ms 1536 KB Output is correct
12 Correct 3 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 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 2 ms 384 KB Output is correct
5 Correct 3 ms 1536 KB Output is correct
6 Correct 2 ms 1536 KB Output is correct
7 Correct 2 ms 1408 KB Output is correct
8 Correct 3 ms 1508 KB Output is correct
9 Correct 2 ms 1536 KB Output is correct
10 Correct 2 ms 1408 KB Output is correct
11 Correct 3 ms 1536 KB Output is correct
12 Correct 3 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 4944 KB Output is correct
16 Correct 5 ms 4224 KB Output is correct
17 Correct 2 ms 384 KB Output is correct
18 Correct 10 ms 7808 KB Output is correct
19 Correct 8 ms 7680 KB Output is correct
20 Correct 9 ms 7660 KB Output is correct
21 Correct 10 ms 7936 KB Output is correct
22 Correct 10 ms 7680 KB Output is correct
23 Correct 8 ms 7552 KB Output is correct
24 Correct 10 ms 7780 KB Output is correct
25 Correct 10 ms 7732 KB Output is correct
26 Correct 9 ms 7592 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 2 ms 384 KB Output is correct
5 Correct 3 ms 1536 KB Output is correct
6 Correct 2 ms 1536 KB Output is correct
7 Correct 2 ms 1408 KB Output is correct
8 Correct 3 ms 1508 KB Output is correct
9 Correct 2 ms 1536 KB Output is correct
10 Correct 2 ms 1408 KB Output is correct
11 Correct 3 ms 1536 KB Output is correct
12 Correct 3 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 4944 KB Output is correct
16 Correct 5 ms 4224 KB Output is correct
17 Correct 2 ms 384 KB Output is correct
18 Correct 10 ms 7808 KB Output is correct
19 Correct 8 ms 7680 KB Output is correct
20 Correct 9 ms 7660 KB Output is correct
21 Correct 10 ms 7936 KB Output is correct
22 Correct 10 ms 7680 KB Output is correct
23 Correct 8 ms 7552 KB Output is correct
24 Correct 10 ms 7780 KB Output is correct
25 Correct 10 ms 7732 KB Output is correct
26 Correct 9 ms 7592 KB Output is correct
27 Correct 139 ms 79756 KB Output is correct
28 Correct 22 ms 25960 KB Output is correct
29 Correct 10 ms 7160 KB Output is correct
30 Correct 2 ms 640 KB Output is correct
31 Correct 107 ms 66432 KB Output is correct
32 Correct 116 ms 79768 KB Output is correct
33 Correct 110 ms 79496 KB Output is correct
34 Correct 126 ms 77204 KB Output is correct
35 Correct 118 ms 79736 KB Output is correct
36 Correct 113 ms 79508 KB Output is correct
37 Correct 149 ms 79820 KB Output is correct
38 Correct 88 ms 66504 KB Output is correct
39 Correct 85 ms 66252 KB Output is correct