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;
typedef long long ll;
const int N=3e3+10;
int n,m,ans;
char grid[N][N];
int main(){
cin>>n>>m;
for(int i=0;i<n;++i)
for(int j=0;j<m;++j)
cin>>grid[i][j];
for(int i=0;i<n;++i){
for(int j=0;j<m;++j){
for(int k=0;k<i;++k){
for(int l=0;l<j;++l){
if(grid[k][l]=='J'&&grid[k][j]=='O'&&grid[i][l]=='I') ++ans;
}
}
}
}
cout<<ans;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |