#include <bits/stdc++.h>
#define ll long long
#define fi first
#define se second
#define ve vector
#define all(x) x.begin(), x.end()
using namespace std;
typedef pair<ll, ll> pll;
typedef pair<int, int> pii;
#pragma GCC optimize("O3")
signed main(){
int n, m;
cin >> n >> m;
ve<string> v(n);
for(auto& i : v)
cin >> i;
int res = 0;
for(int i = 0; i < n; i++)
for(int j = 0; j < n; j++)
for(int k = i + 1; k < n; k++)
for(int l = j + 1; l < m; l++)
res += v[i][j] == 'J' && v[i][l] == 'O' && v[k][j] == 'I';
cout << res;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
8 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Incorrect |
11 ms |
348 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
8 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Incorrect |
11 ms |
348 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
348 KB |
Output is correct |
2 |
Correct |
1 ms |
348 KB |
Output is correct |
3 |
Correct |
1 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
8 ms |
348 KB |
Output is correct |
6 |
Correct |
2 ms |
348 KB |
Output is correct |
7 |
Incorrect |
11 ms |
348 KB |
Output isn't correct |
8 |
Halted |
0 ms |
0 KB |
- |