Submission #1013093

#TimeUsernameProblemLanguageResultExecution timeMemory
1013093aufanBitaro the Brave (JOI19_ho_t1)C++17
100 / 100
119 ms18228 KiB
#include <bits/stdc++.h> #define int long long #define fi first #define se second using namespace std; int32_t main() { ios_base::sync_with_stdio(false); cin.tie(NULL); int n, m; cin >> n >> m; vector<vector<char>> c(n + 1, vector<char>(m + 1)); for (int i = 1; i <= n; i++) { for (int j = 1; j <= m; j++) { cin >> c[i][j]; } } int ans = 0; vector<int> ci(m + 1); for (int i = n; i >= 1; i--) { int co = 0; for (int j = m; j >= 1; j--) { if (c[i][j] == 'J') { ans += ci[j] * co; } if (c[i][j] == 'O') { co += 1; } if (c[i][j] == 'I') { ci[j] += 1; } } } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...