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;
int arr[3005][3005];
vector<int> il;
vector<int> ij;
vector<int> ji;
vector<int> kj;
int main(){
int r,c;
cin >> r >> c;
for(int i=0;i<r;i++){
for(int j=0;j<c;j++){
cin >> arr[i][j];
if(arr[i][j]=='J'){
ij.push_back(i);
ji.push_back(j);
}
else if(arr[i][j]=='O'){
il.push_back(i);
}
else if(arr[i][j]=='I'){
kj.push_back(j);
}
}
}
int cnti=0,cntj=0;
for(int i : il){
for(int j : ij){
if(i==j){
cnti++;
break;
}
}
}
for(int i : ji){
for(int j : kj){
if(i==j){
cntj++;
break;
}
}
}
cout << cnti*cntj;
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |