답안 #99000

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
99000 2019-02-28T05:03:10 Z ainta Bitaro the Brave (JOI19_ho_t1) C++17
100 / 100
321 ms 47228 KB
#include<cstdio>
#include<algorithm>
char p[3010][3010];
int w[3010][3010];
long long res;
int n, m;
int main() {
	int i, j;
	scanf("%d%d", &n, &m);
	for (i = 1; i <= n; i++) {
		scanf("%s", p[i] + 1);
	}
	for (i = 1; i <= n; i++) {
		int c = 0;
		for (j = m; j >= 1; j--) {
			if (p[i][j] == 'O')c++;
			if (p[i][j] == 'J')w[i][j] = c;
		}
	}
	for (i = 1; i <= m; i++) {
		int c = 0;
		for (j = n; j >= 1; j--) {
			if (p[j][i] == 'I')c++;
			if (p[j][i] == 'J')res += w[j][i] * c;
		}
	}
	printf("%lld\n", res);
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:9: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:11:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   scanf("%s", p[i] + 1);
   ~~~~~^~~~~~~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 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 1024 KB Output is correct
6 Correct 3 ms 1024 KB Output is correct
7 Correct 3 ms 896 KB Output is correct
8 Correct 3 ms 1072 KB Output is correct
9 Correct 3 ms 1024 KB Output is correct
10 Correct 3 ms 1024 KB Output is correct
11 Correct 3 ms 1024 KB Output is correct
12 Correct 3 ms 1024 KB Output is correct
13 Correct 3 ms 896 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 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 1024 KB Output is correct
6 Correct 3 ms 1024 KB Output is correct
7 Correct 3 ms 896 KB Output is correct
8 Correct 3 ms 1072 KB Output is correct
9 Correct 3 ms 1024 KB Output is correct
10 Correct 3 ms 1024 KB Output is correct
11 Correct 3 ms 1024 KB Output is correct
12 Correct 3 ms 1024 KB Output is correct
13 Correct 3 ms 896 KB Output is correct
14 Correct 10 ms 4760 KB Output is correct
15 Correct 5 ms 3200 KB Output is correct
16 Correct 4 ms 2560 KB Output is correct
17 Correct 2 ms 384 KB Output is correct
18 Correct 10 ms 4992 KB Output is correct
19 Correct 7 ms 4608 KB Output is correct
20 Correct 6 ms 4352 KB Output is correct
21 Correct 10 ms 4992 KB Output is correct
22 Correct 9 ms 4736 KB Output is correct
23 Correct 7 ms 4224 KB Output is correct
24 Correct 12 ms 4992 KB Output is correct
25 Correct 7 ms 4480 KB Output is correct
26 Correct 7 ms 4224 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 384 KB Output is correct
2 Correct 2 ms 256 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 1024 KB Output is correct
6 Correct 3 ms 1024 KB Output is correct
7 Correct 3 ms 896 KB Output is correct
8 Correct 3 ms 1072 KB Output is correct
9 Correct 3 ms 1024 KB Output is correct
10 Correct 3 ms 1024 KB Output is correct
11 Correct 3 ms 1024 KB Output is correct
12 Correct 3 ms 1024 KB Output is correct
13 Correct 3 ms 896 KB Output is correct
14 Correct 10 ms 4760 KB Output is correct
15 Correct 5 ms 3200 KB Output is correct
16 Correct 4 ms 2560 KB Output is correct
17 Correct 2 ms 384 KB Output is correct
18 Correct 10 ms 4992 KB Output is correct
19 Correct 7 ms 4608 KB Output is correct
20 Correct 6 ms 4352 KB Output is correct
21 Correct 10 ms 4992 KB Output is correct
22 Correct 9 ms 4736 KB Output is correct
23 Correct 7 ms 4224 KB Output is correct
24 Correct 12 ms 4992 KB Output is correct
25 Correct 7 ms 4480 KB Output is correct
26 Correct 7 ms 4224 KB Output is correct
27 Correct 321 ms 47228 KB Output is correct
28 Correct 14 ms 15872 KB Output is correct
29 Correct 9 ms 3584 KB Output is correct
30 Correct 3 ms 512 KB Output is correct
31 Correct 212 ms 39704 KB Output is correct
32 Correct 137 ms 39800 KB Output is correct
33 Correct 162 ms 35344 KB Output is correct
34 Correct 241 ms 45424 KB Output is correct
35 Correct 184 ms 41724 KB Output is correct
36 Correct 141 ms 35212 KB Output is correct
37 Correct 301 ms 47096 KB Output is correct
38 Correct 90 ms 32544 KB Output is correct
39 Correct 95 ms 28280 KB Output is correct