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