#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;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
212 KB |
Output is correct |
2 |
Incorrect |
0 ms |
212 KB |
Output isn't correct |
3 |
Halted |
0 ms |
0 KB |
- |