답안 #134423

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
134423 2019-07-22T16:35:06 Z Boxworld Bitaro the Brave (JOI19_ho_t1) C++14
20 / 100
6 ms 2044 KB
#include <bits/stdc++.h>
using namespace std;
const int maxN=3010;
int h[maxN],w[maxN],ans=0;
char s[maxN][maxN];
int main(){
	int n,m;
	scanf("%d%d",&n,&m);
	memset(h,0,sizeof(h));
	memset(w,0,sizeof(w));
	for (int i=0;i<n;i++)scanf("%s",s[i]);
	for (int i=n-1;i>=0;i--)
	for (int j=m-1;j>=0;j--){
		if (s[i][j]=='O')h[i]++;
		if (s[i][j]=='I')w[j]++;
		if (s[i][j]=='J')ans+=h[i]*w[j];
	}
	printf("%d\n",ans);
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:8: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:28: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  for (int i=0;i<n;i++)scanf("%s",s[i]);
                       ~~~~~^~~~~~~~~~~
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 632 KB Output is correct
6 Correct 2 ms 632 KB Output is correct
7 Correct 3 ms 632 KB Output is correct
8 Correct 2 ms 632 KB Output is correct
9 Correct 2 ms 632 KB Output is correct
10 Correct 2 ms 632 KB Output is correct
11 Correct 2 ms 632 KB Output is correct
12 Correct 2 ms 632 KB Output is correct
13 Correct 2 ms 632 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 632 KB Output is correct
6 Correct 2 ms 632 KB Output is correct
7 Correct 3 ms 632 KB Output is correct
8 Correct 2 ms 632 KB Output is correct
9 Correct 2 ms 632 KB Output is correct
10 Correct 2 ms 632 KB Output is correct
11 Correct 2 ms 632 KB Output is correct
12 Correct 2 ms 632 KB Output is correct
13 Correct 2 ms 632 KB Output is correct
14 Correct 5 ms 2044 KB Output is correct
15 Correct 3 ms 1656 KB Output is correct
16 Correct 3 ms 1272 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 6 ms 2040 KB Output is correct
19 Correct 4 ms 2040 KB Output is correct
20 Incorrect 5 ms 2040 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 2 ms 376 KB Output is correct
2 Correct 2 ms 376 KB Output is correct
3 Correct 2 ms 376 KB Output is correct
4 Correct 2 ms 376 KB Output is correct
5 Correct 2 ms 632 KB Output is correct
6 Correct 2 ms 632 KB Output is correct
7 Correct 3 ms 632 KB Output is correct
8 Correct 2 ms 632 KB Output is correct
9 Correct 2 ms 632 KB Output is correct
10 Correct 2 ms 632 KB Output is correct
11 Correct 2 ms 632 KB Output is correct
12 Correct 2 ms 632 KB Output is correct
13 Correct 2 ms 632 KB Output is correct
14 Correct 5 ms 2044 KB Output is correct
15 Correct 3 ms 1656 KB Output is correct
16 Correct 3 ms 1272 KB Output is correct
17 Correct 2 ms 376 KB Output is correct
18 Correct 6 ms 2040 KB Output is correct
19 Correct 4 ms 2040 KB Output is correct
20 Incorrect 5 ms 2040 KB Output isn't correct
21 Halted 0 ms 0 KB -