제출 #162703

#제출 시각아이디문제언어결과실행 시간메모리
162703NachoLibreBitaro the Brave (JOI19_ho_t1)C++14
20 / 100
15 ms5544 KiB
#include <bits/stdc++.h> using namespace std; int n, m, d[3003][3003][3], fp; char a; int main() { ios::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for(int i = 1; i <= n; ++i) { for(int j = 1; j <= m; ++j) { cin >> a; if(a == 'J') d[i][j][0] = 1; else if(a == 'O') d[i][j][1] = 1; else d[i][j][2] = 1; } } for(int i = n; i; --i) { for(int j = m; j; --j) { d[i][j][1] += d[i][j + 1][1]; d[i][j][2] += d[i + 1][j][2]; } } for(int i = 1; i <= n; ++i) { for(int j = 1; j <= m; ++j) { if(d[i][j][0]) { fp += d[i][j][1] * d[i][j][2]; } } } cout << fp << endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...