Submission #963329

#TimeUsernameProblemLanguageResultExecution timeMemory
963329efishelBitaro the Brave (JOI19_ho_t1)C++17
100 / 100
65 ms9292 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using vll = vector <ll>; int main () { cin.tie(nullptr) -> sync_with_stdio(false); ll n, m; cin >> n >> m; vll dp(m, 0); ll ans = 0; for (ll i = 0; i < n; i++) { string str; cin >> str; ll acc = 0; for (ll j = m-1; j >= 0; j--) { switch (str[j]) { case 'J': dp[j] += acc; break; case 'O': acc++; break; case 'I': ans += dp[j]; break; } } } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...