답안 #208066

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
208066 2020-03-10T00:36:15 Z w4123 Bitaro the Brave (JOI19_ho_t1) C++17
20 / 100
27 ms 6776 KB

#include <iostream>
#include <vector>
#include <string>
using namespace std;
int Orb_Count[3005][3005];
int Ingot_Count[3005][3005];
int main()
{
    int H, W;
    cin >> H >> W;
    vector<string> vs(H);
    for (int i = 0; i != H; i++)
    {
        cin >> vs[i];
        if (vs[i][0] == 'O')Orb_Count[i][0] = 1;
        for (int j = 1; j != W; j++)
        {
            if (vs[i][j] == 'O')
            {
                Orb_Count[i][j] = Orb_Count[i][j - 1] + 1;
            }
            else
            {
                Orb_Count[i][j] = Orb_Count[i][j - 1];
            }
        }
    }

    for (int i = 0; i != W; i++)
    {
        if (vs[0][i] == 'I')Ingot_Count[0][i] = 1;
        for (int j = 1; j != H; j++)
        {
            if (vs[j][i] == 'I')Ingot_Count[j][i] = Ingot_Count[j - 1][i] + 1;
            else Ingot_Count[j][i] = Ingot_Count[j - 1][i];
        }
    }
    int Ans = 0;
    for (int i = 0; i != H; i++)
    {
        for (int j = 0; j != W; j++)
        {
            if (vs[i][j] == 'J')
            {
                Ans += (Orb_Count[i][W - 1] - Orb_Count[i][j]) * (Ingot_Count[H - 1][j] - Ingot_Count[i][j]);
                //cout << "I: " << i << " J: " << j << " ORB_COUNT: " << Ingot_Count[i][j] << " " << Ingot_Count[i][W - 1];
            }
        }
    }
    cout << Ans;


}

# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 6 ms 1272 KB Output is correct
6 Correct 6 ms 1144 KB Output is correct
7 Correct 5 ms 1144 KB Output is correct
8 Correct 6 ms 1144 KB Output is correct
9 Correct 5 ms 1144 KB Output is correct
10 Correct 7 ms 1144 KB Output is correct
11 Correct 6 ms 1272 KB Output is correct
12 Correct 6 ms 1272 KB Output is correct
13 Correct 7 ms 1144 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 6 ms 1272 KB Output is correct
6 Correct 6 ms 1144 KB Output is correct
7 Correct 5 ms 1144 KB Output is correct
8 Correct 6 ms 1144 KB Output is correct
9 Correct 5 ms 1144 KB Output is correct
10 Correct 7 ms 1144 KB Output is correct
11 Correct 6 ms 1272 KB Output is correct
12 Correct 6 ms 1272 KB Output is correct
13 Correct 7 ms 1144 KB Output is correct
14 Correct 19 ms 6136 KB Output is correct
15 Correct 7 ms 3704 KB Output is correct
16 Correct 14 ms 3708 KB Output is correct
17 Correct 5 ms 504 KB Output is correct
18 Correct 27 ms 6776 KB Output is correct
19 Correct 25 ms 6520 KB Output is correct
20 Incorrect 22 ms 6648 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 5 ms 376 KB Output is correct
2 Correct 5 ms 376 KB Output is correct
3 Correct 5 ms 376 KB Output is correct
4 Correct 5 ms 376 KB Output is correct
5 Correct 6 ms 1272 KB Output is correct
6 Correct 6 ms 1144 KB Output is correct
7 Correct 5 ms 1144 KB Output is correct
8 Correct 6 ms 1144 KB Output is correct
9 Correct 5 ms 1144 KB Output is correct
10 Correct 7 ms 1144 KB Output is correct
11 Correct 6 ms 1272 KB Output is correct
12 Correct 6 ms 1272 KB Output is correct
13 Correct 7 ms 1144 KB Output is correct
14 Correct 19 ms 6136 KB Output is correct
15 Correct 7 ms 3704 KB Output is correct
16 Correct 14 ms 3708 KB Output is correct
17 Correct 5 ms 504 KB Output is correct
18 Correct 27 ms 6776 KB Output is correct
19 Correct 25 ms 6520 KB Output is correct
20 Incorrect 22 ms 6648 KB Output isn't correct
21 Halted 0 ms 0 KB -