#include <bits/stdc++.h>
using namespace std;
const int maxn = 3e2 + 10;
int numO[maxn];
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];
}
}
for(int i = 0; i < H; i++)
{
for(int j = 0; j < W; j++)
{
if(tab[i][j] == 'O') numO[i]++;
}
}
int cont = 0;
for(int i = 0; i < H - 1; i++)
{
for(int k = i + 1; k < H; k++)
{
for(int j = 0; j < W - 1; j++)
{
if(tab[i][j] == 'J' and tab[k][j] == 'I')
cont += numO[i];
}
}
}
cout << cont << "\n";
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
3 ms |
384 KB |
Output is correct |
2 |
Correct |
2 ms |
256 KB |
Output is correct |
3 |
Correct |
2 ms |
256 KB |
Output is correct |
4 |
Incorrect |
3 ms |
384 KB |
Output isn't correct |
5 |
Halted |
0 ms |
0 KB |
- |