# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
110425 | said | Bitaro the Brave (JOI19_ho_t1) | C++14 | 436 ms | 155832 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <iostream>
using namespace std;
#define int long long
#define MAX 3100
string s[MAX];
int h, w, v1[MAX][MAX], v2[MAX][MAX];
main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL); cout.tie(NULL);
cin >> h >> w;
for(int i = 0; i < h; i++)
cin >> s[i];
int qt = 0;
for(int j = 0; j < w; j++){
qt = 0;
for(int i = h-1; i >= 0; i--){
v1[i][j] += qt;
if(s[i][j] == 'I'){
qt++;
}
}
}
for(int i = 0; i < h; i++){
qt = 0;
for(int j = w-1; j >= 0; j--){
v2[i][j] += qt;
if(s[i][j] == 'O'){
qt++;
}
}
}
int ans = 0;
for(int i = 0; i < h; i++){
for(int j = 0; j < w; j++){
if(s[i][j] == 'J'){
ans += v1[i][j]*v2[i][j];
}
}
}
cout << ans << "\n";
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... |