Submission #765433

#TimeUsernameProblemLanguageResultExecution timeMemory
765433LinkedArrayBitaro the Brave (JOI19_ho_t1)C++17
100 / 100
68 ms18928 KiB
#include <bits/stdc++.h> using namespace std; const int MAXH = 3000; string v[MAXH]; int ingots[MAXH]; int main() { ios_base::sync_with_stdio(false); cin.tie(0); int h, w, i, j, orbs; long long ans; cin >> h >> w; for(i = 0; i < h; i++){ cin >> v[i]; } ans = 0; for(i = h - 1; i >= 0; i--){ orbs = 0; for(j = w - 1; j >= 0; j--){ switch(v[i][j]){ case 'O': ++orbs; break; case 'I': ++ingots[j]; break; case 'J': ans += 1LL * orbs * ingots[j]; break; } } } cout << ans; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...