제출 #151099

#제출 시각아이디문제언어결과실행 시간메모리
151099karmaBitaro the Brave (JOI19_ho_t1)C++17
100 / 100
93 ms10128 KiB
#include <bits/stdc++.h> using namespace std; const int N = int(3e3) + 1; string s[N]; long long res = 0; int n, m, c[N], cur; int main() { ios_base::sync_with_stdio(0); cin.tie(0), cout.tie(0); cin >> n >> m; for(int i = 0; i < n; ++i) cin >> s[i]; for(int i = n - 1; i >= 0; --i) { cur = 0; for(int j = 0; j < m; ++j) { if(s[i][j] == 'O') res += cur; else if(s[i][j] == 'I') ++c[j]; else cur += c[j]; } } cout << res; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...