#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N=3e3+10;
int n,m,ans;
char grid[N][N];
int main(){
cin>>n>>m;
for(int i=0;i<n;++i)
for(int j=0;j<m;++j)
cin>>grid[i][j];
for(int i=0;i<n;++i){
for(int j=0;j<m;++j){
for(int k=0;k<i;++k){
for(int l=0;l<j;++l){
if(grid[k][l]=='J'&&grid[k][j]=='O'&&grid[i][l]=='I') ++ans;
}
}
}
}
cout<<ans;
}
# |
결과 |
실행 시간 |
메모리 |
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 |
248 KB |
Output is correct |
5 |
Correct |
126 ms |
668 KB |
Output is correct |
6 |
Correct |
18 ms |
632 KB |
Output is correct |
7 |
Correct |
34 ms |
632 KB |
Output is correct |
8 |
Correct |
126 ms |
680 KB |
Output is correct |
9 |
Correct |
22 ms |
632 KB |
Output is correct |
10 |
Correct |
34 ms |
632 KB |
Output is correct |
11 |
Correct |
138 ms |
636 KB |
Output is correct |
12 |
Correct |
21 ms |
632 KB |
Output is correct |
13 |
Correct |
34 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 |
248 KB |
Output is correct |
5 |
Correct |
126 ms |
668 KB |
Output is correct |
6 |
Correct |
18 ms |
632 KB |
Output is correct |
7 |
Correct |
34 ms |
632 KB |
Output is correct |
8 |
Correct |
126 ms |
680 KB |
Output is correct |
9 |
Correct |
22 ms |
632 KB |
Output is correct |
10 |
Correct |
34 ms |
632 KB |
Output is correct |
11 |
Correct |
138 ms |
636 KB |
Output is correct |
12 |
Correct |
21 ms |
632 KB |
Output is correct |
13 |
Correct |
34 ms |
632 KB |
Output is correct |
14 |
Execution timed out |
1062 ms |
2040 KB |
Time limit exceeded |
15 |
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 |
248 KB |
Output is correct |
5 |
Correct |
126 ms |
668 KB |
Output is correct |
6 |
Correct |
18 ms |
632 KB |
Output is correct |
7 |
Correct |
34 ms |
632 KB |
Output is correct |
8 |
Correct |
126 ms |
680 KB |
Output is correct |
9 |
Correct |
22 ms |
632 KB |
Output is correct |
10 |
Correct |
34 ms |
632 KB |
Output is correct |
11 |
Correct |
138 ms |
636 KB |
Output is correct |
12 |
Correct |
21 ms |
632 KB |
Output is correct |
13 |
Correct |
34 ms |
632 KB |
Output is correct |
14 |
Execution timed out |
1062 ms |
2040 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |