# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
233934 | nicolaalexandra | Bitaro the Brave (JOI19_ho_t1) | C++14 | 712 ms | 88824 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
#define DIM 3010
using namespace std;
char a[DIM][DIM];
int dp_right[DIM][DIM],dp_up[DIM][DIM];
int n,m,i,j;
int main (){
//ifstream cin ("date.in");
//ofstream cout ("date.out");
cin>>n>>m;
for (i=1;i<=n;i++)
cin>>a[i]+1;
for (i=1;i<=n;i++){
for (j=m;j;j--){
dp_right[i][j] = dp_right[i][j+1];
if (a[i][j] == 'O')
dp_right[i][j]++;
}
}
for (j=1;j<=m;j++){
for (i=n;i;i--){
dp_up[i][j] = dp_up[i+1][j];
if (a[i][j] == 'I')
dp_up[i][j]++;
}
}
long long sol = 0;
for (i=1;i<=n;i++)
for (j=1;j<=m;j++)
if (a[i][j] == 'J')
sol += 1LL * dp_right[i][j] * dp_up[i][j];
cout<<sol;
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... |