# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
404840 | radaiosm7 | Bitaro the Brave (JOI19_ho_t1) | C++98 | 274 ms | 88464 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
#define X first
#define Y second
int n, m, i, j;
char c, mat[3005][3005];
long long ans;
vector<pair<int, int> > Jew;
int col[3005][3005];
int row[3005][3005];
int main() {
scanf("%d%d", &n, &m);
for (i=0; i < n; ++i) {
scanf("\n%s", mat[i]);
}
for (i=0; i < n; ++i) {
row[i][m-1] = 0;
for (j=m-1; j >= 0; --j) {
row[i][j] = row[i][j+1] + (mat[i][j]=='O');
}
}
for (j=0; j < m; ++j) {
col[n-1][j] = 0;
for (i=n-1; i >= 0; --i) {
col[i][j] = col[i+1][j] + (mat[i][j]=='I');
}
}
ans = 0LL;
for (i=0; i < n; ++i) {
for (j=0; j < m; ++j) {
if (mat[i][j] == 'J') {
ans += (long long)col[i][j]*row[i][j];
}
}
}
printf("%lld\n", ans);
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... |