#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e3 + 10;
int main()
{
char tab[maxn][maxn];
int H, W;
cin >> H >> W;
for(int i = 0; i < H; i++)
{
for(int j = 0; j < W; j++)
{
cin >> tab[i][j];
}
}
int cont = 0;
for(int i = 0; i < H - 1; i++)
{
for(int j = 0; j < W - 1; j++)
{
for(int k = i + 1; k < H; k++)
{
for(int l = j + 1; l < W; l++)
{
if(tab[i][j] == 'J' and tab[i][l] == 'O' and tab[k][j] == 'I')
cont++;
}
}
}
}
cout << cont << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
20 ms |
768 KB |
Output is correct |
6 |
Correct |
15 ms |
640 KB |
Output is correct |
7 |
Correct |
20 ms |
512 KB |
Output is correct |
8 |
Correct |
20 ms |
640 KB |
Output is correct |
9 |
Correct |
14 ms |
640 KB |
Output is correct |
10 |
Correct |
24 ms |
640 KB |
Output is correct |
11 |
Correct |
21 ms |
640 KB |
Output is correct |
12 |
Correct |
15 ms |
660 KB |
Output is correct |
13 |
Correct |
24 ms |
632 KB |
Output is correct |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
20 ms |
768 KB |
Output is correct |
6 |
Correct |
15 ms |
640 KB |
Output is correct |
7 |
Correct |
20 ms |
512 KB |
Output is correct |
8 |
Correct |
20 ms |
640 KB |
Output is correct |
9 |
Correct |
14 ms |
640 KB |
Output is correct |
10 |
Correct |
24 ms |
640 KB |
Output is correct |
11 |
Correct |
21 ms |
640 KB |
Output is correct |
12 |
Correct |
15 ms |
660 KB |
Output is correct |
13 |
Correct |
24 ms |
632 KB |
Output is correct |
14 |
Execution timed out |
1066 ms |
1792 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
2 ms |
256 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Correct |
2 ms |
384 KB |
Output is correct |
5 |
Correct |
20 ms |
768 KB |
Output is correct |
6 |
Correct |
15 ms |
640 KB |
Output is correct |
7 |
Correct |
20 ms |
512 KB |
Output is correct |
8 |
Correct |
20 ms |
640 KB |
Output is correct |
9 |
Correct |
14 ms |
640 KB |
Output is correct |
10 |
Correct |
24 ms |
640 KB |
Output is correct |
11 |
Correct |
21 ms |
640 KB |
Output is correct |
12 |
Correct |
15 ms |
660 KB |
Output is correct |
13 |
Correct |
24 ms |
632 KB |
Output is correct |
14 |
Execution timed out |
1066 ms |
1792 KB |
Time limit exceeded |
15 |
Halted |
0 ms |
0 KB |
- |