#include <iostream>
using namespace std;
#define MAXH 3010
int h, w;
string s[MAXH];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin >> h >> w;
for(int i = 0; i < h; i++)
cin >> s[i];
int qt = 0;
for(int i = 0; i < h-1; i++){
for(int j = 0; j < w-1; j++){
if(s[i][j] == 'J'){
int l = 0;
for(int e = 0; e < w; e++){
if(s[i][e] == 'O'){
l = e;
if(j < l){
int k = 0;
for(int x = 0; x < h; x++){
if(s[x][j] == 'I'){
k = x;
if(i < k && j < l){
qt++;
}
}
}
}
}
}
}
}
}
cout << qt << "\n";
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
512 KB |
Output is correct |
2 |
Correct |
2 ms |
512 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
19 ms |
512 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
7 |
Correct |
16 ms |
384 KB |
Output is correct |
8 |
Correct |
14 ms |
492 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
16 ms |
512 KB |
Output is correct |
11 |
Correct |
16 ms |
512 KB |
Output is correct |
12 |
Correct |
7 ms |
384 KB |
Output is correct |
13 |
Correct |
20 ms |
484 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
512 KB |
Output is correct |
2 |
Correct |
2 ms |
512 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
19 ms |
512 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
7 |
Correct |
16 ms |
384 KB |
Output is correct |
8 |
Correct |
14 ms |
492 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
16 ms |
512 KB |
Output is correct |
11 |
Correct |
16 ms |
512 KB |
Output is correct |
12 |
Correct |
7 ms |
384 KB |
Output is correct |
13 |
Correct |
20 ms |
484 KB |
Output is correct |
14 |
Execution timed out |
1075 ms |
640 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
512 KB |
Output is correct |
2 |
Correct |
2 ms |
512 KB |
Output is correct |
3 |
Correct |
2 ms |
384 KB |
Output is correct |
4 |
Correct |
4 ms |
384 KB |
Output is correct |
5 |
Correct |
19 ms |
512 KB |
Output is correct |
6 |
Correct |
5 ms |
384 KB |
Output is correct |
7 |
Correct |
16 ms |
384 KB |
Output is correct |
8 |
Correct |
14 ms |
492 KB |
Output is correct |
9 |
Correct |
5 ms |
384 KB |
Output is correct |
10 |
Correct |
16 ms |
512 KB |
Output is correct |
11 |
Correct |
16 ms |
512 KB |
Output is correct |
12 |
Correct |
7 ms |
384 KB |
Output is correct |
13 |
Correct |
20 ms |
484 KB |
Output is correct |
14 |
Execution timed out |
1075 ms |
640 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |