Submission #998392

#TimeUsernameProblemLanguageResultExecution timeMemory
998392RaresFelixBitaro the Brave (JOI19_ho_t1)C++17
100 / 100
77 ms19032 KiB
#include <bits/stdc++.h> using namespace std; using ll = long long; using vi = vector<int>; int main() { cin.tie(0); ios_base::sync_with_stdio(0); int h, w; cin >> h >> w; vector<string> S(h); for(int i = 0; i < h; ++i) { cin >> S[i]; reverse(S[i].begin(), S[i].end()); } reverse(S.begin(), S.end()); vi Fi(h, 0), Fj(w, 0); ll re = 0; for(int i = 0; i < h; ++i) for(int j = 0; j < w; ++j) { if(S[i][j] == 'O') ++Fi[i]; if(S[i][j] == 'I') ++Fj[j]; if(S[i][j] == 'J') { int cre = Fi[i] * Fj[j]; if(cre) re += cre; } } cout << re << "\n"; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...