답안 #145178

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
145178 2019-08-19T08:12:11 Z TadijaSebez Bitaro the Brave (JOI19_ho_t1) C++11
100 / 100
152 ms 89848 KB
#include <bits/stdc++.h>
using namespace std;
#define ll long long
const int N=3050;
char s[N][N];
int I[N][N],O[N][N];
int main()
{
	int n,m;
	scanf("%i %i",&n,&m);
    for(int i=1;i<=n;i++) scanf("%s",s[i]+1);
    ll ans=0;
    for(int i=n;i>=1;i--)
	{
		for(int j=m;j>=1;j--)
		{
			O[i][j]=O[i][j+1]+(s[i][j]=='O');
			I[i][j]=I[i+1][j]+(s[i][j]=='I');
			if(s[i][j]=='J') ans+=(ll)O[i][j]*I[i][j];
		}
	}
	printf("%lld\n",ans);
	return 0;
}

Compilation message

joi2019_ho_t1.cpp: In function 'int main()':
joi2019_ho_t1.cpp:10:7: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
  scanf("%i %i",&n,&m);
  ~~~~~^~~~~~~~~~~~~~~
joi2019_ho_t1.cpp:11:32: 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",s[i]+1);
                           ~~~~~^~~~~~~~~~~~~
# 결과 실행 시간 메모리 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 504 KB Output is correct
5 Correct 4 ms 1532 KB Output is correct
6 Correct 3 ms 1532 KB Output is correct
7 Correct 3 ms 1400 KB Output is correct
8 Correct 4 ms 1528 KB Output is correct
9 Correct 4 ms 1532 KB Output is correct
10 Correct 3 ms 1400 KB Output is correct
11 Correct 4 ms 1528 KB Output is correct
12 Correct 4 ms 1532 KB Output is correct
13 Correct 3 ms 1400 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 504 KB Output is correct
5 Correct 4 ms 1532 KB Output is correct
6 Correct 3 ms 1532 KB Output is correct
7 Correct 3 ms 1400 KB Output is correct
8 Correct 4 ms 1528 KB Output is correct
9 Correct 4 ms 1532 KB Output is correct
10 Correct 3 ms 1400 KB Output is correct
11 Correct 4 ms 1528 KB Output is correct
12 Correct 4 ms 1532 KB Output is correct
13 Correct 3 ms 1400 KB Output is correct
14 Correct 10 ms 7544 KB Output is correct
15 Correct 6 ms 4984 KB Output is correct
16 Correct 6 ms 4344 KB Output is correct
17 Correct 2 ms 504 KB Output is correct
18 Correct 11 ms 8056 KB Output is correct
19 Correct 10 ms 7932 KB Output is correct
20 Correct 10 ms 7928 KB Output is correct
21 Correct 11 ms 8056 KB Output is correct
22 Correct 10 ms 7928 KB Output is correct
23 Correct 12 ms 7928 KB Output is correct
24 Correct 11 ms 8056 KB Output is correct
25 Correct 10 ms 7932 KB Output is correct
26 Correct 10 ms 7856 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 504 KB Output is correct
5 Correct 4 ms 1532 KB Output is correct
6 Correct 3 ms 1532 KB Output is correct
7 Correct 3 ms 1400 KB Output is correct
8 Correct 4 ms 1528 KB Output is correct
9 Correct 4 ms 1532 KB Output is correct
10 Correct 3 ms 1400 KB Output is correct
11 Correct 4 ms 1528 KB Output is correct
12 Correct 4 ms 1532 KB Output is correct
13 Correct 3 ms 1400 KB Output is correct
14 Correct 10 ms 7544 KB Output is correct
15 Correct 6 ms 4984 KB Output is correct
16 Correct 6 ms 4344 KB Output is correct
17 Correct 2 ms 504 KB Output is correct
18 Correct 11 ms 8056 KB Output is correct
19 Correct 10 ms 7932 KB Output is correct
20 Correct 10 ms 7928 KB Output is correct
21 Correct 11 ms 8056 KB Output is correct
22 Correct 10 ms 7928 KB Output is correct
23 Correct 12 ms 7928 KB Output is correct
24 Correct 11 ms 8056 KB Output is correct
25 Correct 10 ms 7932 KB Output is correct
26 Correct 10 ms 7856 KB Output is correct
27 Correct 138 ms 89252 KB Output is correct
28 Correct 26 ms 26104 KB Output is correct
29 Correct 12 ms 7928 KB Output is correct
30 Correct 13 ms 632 KB Output is correct
31 Correct 110 ms 73556 KB Output is correct
32 Correct 118 ms 89744 KB Output is correct
33 Correct 118 ms 89380 KB Output is correct
34 Correct 127 ms 85368 KB Output is correct
35 Correct 116 ms 89608 KB Output is correct
36 Correct 118 ms 89528 KB Output is correct
37 Correct 152 ms 89848 KB Output is correct
38 Correct 97 ms 73648 KB Output is correct
39 Correct 101 ms 73308 KB Output is correct