# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1105154 | salmon | Bitaro the Brave (JOI19_ho_t1) | C++14 | 382 ms | 93528 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
int H,W;
char lst[3100][3100];
int I[3100][3100];
int O[3100][3100];
long long int ans = 0;
int main(){
scanf(" %d",&H);
scanf(" %d",&W);
for(int i = 0; i < H; i++){
for(int j = 0; j < W; j++){
scanf(" %c",&lst[i][j]);
}
}
for(int i = 0; i < H; i++){
O[i][W - 1] = 0;
if(lst[i][W - 1] == 'O'){
O[i][W - 1]++;
}
for(int j = W - 2; j >= 0; j--){
O[i][j] = O[i][j + 1];
if(lst[i][j] == 'O') O[i][j]++;
}
}
for(int j = 0; j < W; j++){
I[H - 1][j] = 0;
if(lst[H - 1][j] == 'I'){
I[H - 1][j]++;
}
for(int i = H - 2; i >= 0; i--){
I[i][j] = I[i + 1][j];
if(lst[i][j] == 'I') I[i][j]++;
}
}
for(int i = 0; i < H; i++){
for(int j = 0; j < W; j++){
if(lst[i][j] == 'J') ans += I[i][j] * O[i][j];
}
}
printf("%lld",ans);
}
컴파일 시 표준 에러 (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... |