This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define all(x) x.begin(),x.end()
#define sor(x) sort(all(x))
#define pi pair<int,int>
#define vi vector<int>
int N,M;
vector<string>A;
void solve() {
cin >> N >> M;
A = vector<string>(N);
for (int i = 0; i < N;++i)
cin >> A[i];
int cnt = 0;
for (int i = 0; i < N;++i)
for (int j = 0; j < N;++j)
for (int z = i + 1; z < N;++z)
for (int y = j + 1; y < N;++y)
if (A[i][j] == 'J' && A[z][y] == 'I' && A[i][y] == 'O')
++cnt;
cout << cnt;
}
int main(){
solve();
return 0;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |