# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
366554 | Tuk1352 | Bitaro the Brave (JOI19_ho_t1) | C++11 | 884 ms | 88556 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int main()
{
int n, m, p;
cin >> n >> m;
char C[n][m];
int H[n][m], R[n][m];
for (int i = 0; i < n; i++)
{
for (int y = 0; y < m; y++)
{
cin >> C[i][y];
H[i][y] = 0;
R[i][y] = 0;
}
}
for (int i = 0; i < n; i++)
{
for (int y = m-1; y >= 0; y--)
{
if (y == m-1)
{
R[i][y] = 0;
}
else
{
R[i][y] = R[i][y+1];
}
if (C[i][y] == 'O')
{
R[i][y]++;
}
}
}
for (int y = 0; y < m; y++)
{
for (int i = n-1; i >= 0; i--)
{
if (i == n-1)
{
H[i][y] = 0;
}
else
{
H[i][y] = H[i+1][y];
}
if (C[i][y] == 'I')
{
H[i][y]++;
}
}
}
long long S = 0;
for (int i = 0; i < n; i++)
{
for (int y = 0; y < m; y++)
{
if (C[i][y] == 'J')
{
S += H[i][y] * R[i][y];
}
}
}
cout << S;
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |