답안 #334240

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
334240 2020-12-08T17:59:46 Z Tahmid690 Bitaro the Brave (JOI19_ho_t1) C++14
0 / 100
1 ms 364 KB
#include<bits/stdc++.h>
using namespace std;
#define ll long long
int main(){
    int h,w;
    string s[3005];
    cin >> h >> w;
    for(int i=0;i<h;i++) cin >> s[i];
    unordered_map<ll,int> rows;
    unordered_map<ll,int> colum;
    for(int i=0;i<h;i++){
        ll x=0,y=0;
        for(int j=0;j<w;j++){
            if(s[i][j]=='O') x++;
            if(s[j][i]=='I') y++;
        }
        rows[i]=x;
        colum[i]=y;
    }
    ll ans=0;
    for(int i=0;i<h;i++){
        for(int j=0;j<w;j++){
            if(s[i][j]=='J') ans+=(rows[i]*colum[j]);
        }
    }
    cout << ans << endl;
    
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 364 KB Output is correct
2 Correct 1 ms 364 KB Output is correct
3 Correct 1 ms 364 KB Output is correct
4 Incorrect 1 ms 364 KB Output isn't correct
5 Halted 0 ms 0 KB -