답안 #253388

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
253388 2020-07-27T21:24:21 Z ChrisT Bitaro the Brave (JOI19_ho_t1) C++17
100 / 100
106 ms 17916 KB
#include<bits/stdc++.h>
using namespace std;
char grid[3005][3005]; int col[3005], row[3005];
int main () {
	int n,m;
	scanf ("%d %d",&n,&m);
	for (int i = 1; i <= n; i++) scanf ("%s",grid[i]+1);
	long long ans = 0;
	for (int i = n; i >= 1; i--) {
		for (int j = m; j >= 1; j--) {
			if (grid[i][j] == 'J') ans += row[i] * col[j];
			else if (grid[i][j] == 'O') ++row[i];
			else ++col[j];
		}
	}
	printf ("%lld\n",ans);
	return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:6:8: 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:7:37: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (int i = 1; i <= n; i++) scanf ("%s",grid[i]+1);
                               ~~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 640 KB Output is correct
6 Correct 1 ms 640 KB Output is correct
7 Correct 1 ms 640 KB Output is correct
8 Correct 1 ms 640 KB Output is correct
9 Correct 1 ms 640 KB Output is correct
10 Correct 1 ms 640 KB Output is correct
11 Correct 1 ms 640 KB Output is correct
12 Correct 1 ms 640 KB Output is correct
13 Correct 1 ms 640 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 640 KB Output is correct
6 Correct 1 ms 640 KB Output is correct
7 Correct 1 ms 640 KB Output is correct
8 Correct 1 ms 640 KB Output is correct
9 Correct 1 ms 640 KB Output is correct
10 Correct 1 ms 640 KB Output is correct
11 Correct 1 ms 640 KB Output is correct
12 Correct 1 ms 640 KB Output is correct
13 Correct 1 ms 640 KB Output is correct
14 Correct 3 ms 1924 KB Output is correct
15 Correct 1 ms 1536 KB Output is correct
16 Correct 2 ms 1152 KB Output is correct
17 Correct 1 ms 384 KB Output is correct
18 Correct 4 ms 2048 KB Output is correct
19 Correct 3 ms 2048 KB Output is correct
20 Correct 3 ms 2048 KB Output is correct
21 Correct 6 ms 2048 KB Output is correct
22 Correct 3 ms 2048 KB Output is correct
23 Correct 3 ms 2048 KB Output is correct
24 Correct 4 ms 2048 KB Output is correct
25 Correct 3 ms 2048 KB Output is correct
26 Correct 3 ms 2048 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 384 KB Output is correct
2 Correct 0 ms 384 KB Output is correct
3 Correct 0 ms 384 KB Output is correct
4 Correct 1 ms 384 KB Output is correct
5 Correct 1 ms 640 KB Output is correct
6 Correct 1 ms 640 KB Output is correct
7 Correct 1 ms 640 KB Output is correct
8 Correct 1 ms 640 KB Output is correct
9 Correct 1 ms 640 KB Output is correct
10 Correct 1 ms 640 KB Output is correct
11 Correct 1 ms 640 KB Output is correct
12 Correct 1 ms 640 KB Output is correct
13 Correct 1 ms 640 KB Output is correct
14 Correct 3 ms 1924 KB Output is correct
15 Correct 1 ms 1536 KB Output is correct
16 Correct 2 ms 1152 KB Output is correct
17 Correct 1 ms 384 KB Output is correct
18 Correct 4 ms 2048 KB Output is correct
19 Correct 3 ms 2048 KB Output is correct
20 Correct 3 ms 2048 KB Output is correct
21 Correct 6 ms 2048 KB Output is correct
22 Correct 3 ms 2048 KB Output is correct
23 Correct 3 ms 2048 KB Output is correct
24 Correct 4 ms 2048 KB Output is correct
25 Correct 3 ms 2048 KB Output is correct
26 Correct 3 ms 2048 KB Output is correct
27 Correct 104 ms 17400 KB Output is correct
28 Correct 4 ms 7168 KB Output is correct
29 Correct 7 ms 1792 KB Output is correct
30 Correct 1 ms 384 KB Output is correct
31 Correct 79 ms 13816 KB Output is correct
32 Correct 60 ms 17916 KB Output is correct
33 Correct 56 ms 17912 KB Output is correct
34 Correct 90 ms 15992 KB Output is correct
35 Correct 60 ms 17912 KB Output is correct
36 Correct 55 ms 17912 KB Output is correct
37 Correct 106 ms 17912 KB Output is correct
38 Correct 44 ms 13824 KB Output is correct
39 Correct 39 ms 13688 KB Output is correct