답안 #788244

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
788244 2023-07-20T03:19:07 Z 12345678 Bitaro the Brave (JOI19_ho_t1) C++17
0 / 100
1 ms 328 KB
#include <bits/stdc++.h>

using namespace std;

const int nx=3e3+100;
long long h, w, dpr[nx], dpc[nx];
long long ans;
char c;
vector<pair<int, int>> v;

int main()
{
    cin.tie(NULL)->sync_with_stdio(false);
    cin>>h>>w;
    for (int i=1; i<=h; i++)
    {
        for (int j=1; j<=w; j++)
        {
            cin>>c;
            if (c=='J') v.push_back({i, j});
            if (c=='O') dpr[i]++;
            if (c=='I') dpc[j]++;
        }
    }
    for (auto [x, y]:v) ans+=dpr[y]*dpc[x];
    cout<<ans;
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 328 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 328 KB Output isn't correct
4 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 212 KB Output is correct
2 Correct 0 ms 212 KB Output is correct
3 Incorrect 1 ms 328 KB Output isn't correct
4 Halted 0 ms 0 KB -