| # | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
|---|---|---|---|---|---|---|---|
| 818685 | vjudge1 | Bitaro the Brave (JOI19_ho_t1) | C++17 | 409 ms | 152832 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MAXN = 3e3 + 5;
ll h, w;
string a [MAXN];
ll sat [MAXN][MAXN];
ll nol [MAXN][MAXN];
int main(){
cin >> h >> w;
for(ll i = 1; i <= h; i++){
cin >> a[i];
}
for(ll i = 1; i <= h; i++){
for(ll j = w-1; j >= 0; j--){
nol[i][j] = nol[i][j+1];
if(a[i][j] == 'O'){
nol[i][j]++;
}
}
}
for(ll j = 0; j < w; j++){
for(ll i = h; i >= 1; i--){
sat[i][j] = sat[i+1][j];
if(a[i][j] == 'I'){
sat[i][j]++;
}
}
}
ll ans = 0;
for(ll i = 1; i <= h; i++){
for(ll j = 0; j < w; j++){
if(a[i][j] == 'J'){
ans += sat[i][j] * nol[i][j];
}
}
}
cout << ans << endl;
}| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
| # | Verdict | Execution time | Memory | Grader output |
|---|---|---|---|---|
| Fetching results... | ||||
