| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 1355473 | andriabandria | Bitaro the Brave (JOI19_ho_t1) | C++20 | 242 ms | 82268 KiB |
#include <bits/stdc++.h>
using namespace std;
int main() {
int h, w;
cin>>h>>w;
string s[h];
for(int i=0; i<h; i++)
cin>>s[i];
int r[h][w], c[h][w];
for (int i=0; i<h; i++){
int x=0;
for(int j=w-1; j>=0; j--){
r[i][j]=x;
if (s[i][j]=='O') x++;}}
for (int j=0; j<w; j++){
int x = 0;
for (int i=h-1; i>=0; i--){
c[i][j]=x;
if (s[i][j]=='I') x++;}}
long long a=0;
for (int i=0; i<h; i++) {
for (int j=0; j<w; j++) {
if (s[i][j]=='J') {
a+=1LL*r[i][j]*c[i][j];}}}
cout<<a;
return 0;
}| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
| # | 결과 | 실행 시간 | 메모리 | 채점기 출력 |
|---|---|---|---|---|
| 결과를 불러오는 중입니다… | ||||
