답안 #753091

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
753091 2023-06-04T14:40:56 Z CdS Bitaro the Brave (JOI19_ho_t1) C++17
20 / 100
20 ms 7636 KB
#include <bits/stdc++.h>

using namespace std;


int orbes[3010][3010];
int ingots[3010][3010];
char grid[3010][3010];
int main()
{
    int h, w;

    cin >> h >> w;


    for (int i = 0; i < h; i++)
    {
	for (int j = 0; j < w; j++)
	{
	    cin >> grid[i][j];
	}
    }

    for (int i = 0; i < h; i++)
    {
	for (int j = w; j >= 0; j--)
	{
	    orbes[i][j] = orbes[i][j+1] + (grid[i][j] == 'O');
	}
    }

    for (int j = 0; j < w; j++)
    {
	for (int i = h; i >= 0; i--)
	{
	    ingots[i][j] = ingots[i+1][j] + (grid[i][j] == 'I');
	}
    }

    int ans = 0;
    for (int i = 0; i < h; i++)
    {
	for (int j = 0; j < w; j++)
	{
	    if (grid[i][j] == 'J')
	    {
		ans += ingots[i][j] * orbes[i][j];
	    }
	}
    }


    cout << ans;

    return 0;
}

# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 2 ms 1492 KB Output is correct
6 Correct 2 ms 1364 KB Output is correct
7 Correct 2 ms 1364 KB Output is correct
8 Correct 2 ms 1492 KB Output is correct
9 Correct 2 ms 1364 KB Output is correct
10 Correct 1 ms 1364 KB Output is correct
11 Correct 2 ms 1492 KB Output is correct
12 Correct 2 ms 1364 KB Output is correct
13 Correct 2 ms 1364 KB Output is correct
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 2 ms 1492 KB Output is correct
6 Correct 2 ms 1364 KB Output is correct
7 Correct 2 ms 1364 KB Output is correct
8 Correct 2 ms 1492 KB Output is correct
9 Correct 2 ms 1364 KB Output is correct
10 Correct 1 ms 1364 KB Output is correct
11 Correct 2 ms 1492 KB Output is correct
12 Correct 2 ms 1364 KB Output is correct
13 Correct 2 ms 1364 KB Output is correct
14 Correct 18 ms 7200 KB Output is correct
15 Correct 4 ms 4948 KB Output is correct
16 Correct 10 ms 4156 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 19 ms 7636 KB Output is correct
19 Correct 19 ms 7612 KB Output is correct
20 Incorrect 20 ms 7636 KB Output isn't correct
21 Halted 0 ms 0 KB -
# 결과 실행 시간 메모리 Grader output
1 Correct 0 ms 340 KB Output is correct
2 Correct 0 ms 340 KB Output is correct
3 Correct 1 ms 340 KB Output is correct
4 Correct 0 ms 340 KB Output is correct
5 Correct 2 ms 1492 KB Output is correct
6 Correct 2 ms 1364 KB Output is correct
7 Correct 2 ms 1364 KB Output is correct
8 Correct 2 ms 1492 KB Output is correct
9 Correct 2 ms 1364 KB Output is correct
10 Correct 1 ms 1364 KB Output is correct
11 Correct 2 ms 1492 KB Output is correct
12 Correct 2 ms 1364 KB Output is correct
13 Correct 2 ms 1364 KB Output is correct
14 Correct 18 ms 7200 KB Output is correct
15 Correct 4 ms 4948 KB Output is correct
16 Correct 10 ms 4156 KB Output is correct
17 Correct 1 ms 340 KB Output is correct
18 Correct 19 ms 7636 KB Output is correct
19 Correct 19 ms 7612 KB Output is correct
20 Incorrect 20 ms 7636 KB Output isn't correct
21 Halted 0 ms 0 KB -