# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
531022 | buidangnguyen05 | Bitaro the Brave (JOI19_ho_t1) | C++14 | 347 ms | 118500 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
/* input
*/
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
const int N = 5e3 + 10;
int d[N][N], r[N][N];
char s[N][N];
signed main() {
cin.tie(0)->sync_with_stdio(0);
if (fopen("task.inp", "r")) {
freopen("task.inp", "r", stdin);
freopen("task.out", "w", stdout);
}
int m, n; cin >> m >> n;
for (int i = 1; i <= m; ++i) for (int j = 1; j <= n; ++j) cin >> s[i][j];
for (int i = 1; i <= m; ++i) for (int j = n; j; --j) r[i][j] = r[i][j + 1] + (s[i][j + 1] == 'O');
for (int j = 1; j <= n; ++j) for (int i = m; i; --i) d[i][j] = d[i + 1][j] + (s[i + 1][j] == 'I');
ll res = 0;
for (int i = 1; i <= m; ++i) for (int j = 1; j <= n; ++j) if (s[i][j] == 'J') res += r[i][j] * d[i][j];
cout << res << "\n";
}
컴파일 시 표준 에러 (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... |