Submission #990460

#TimeUsernameProblemLanguageResultExecution timeMemory
990460Zero_OPBitaro the Brave (JOI19_ho_t1)C++14
100 / 100
128 ms18004 KiB
#include<bits/stdc++.h> using namespace std; const int MAX = 3e3 + 5; int n, m, f[MAX]; char a[MAX][MAX]; int main(){ ios_base::sync_with_stdio(0); cin.tie(0); cin >> n >> m; for(int i = 1; i <= n; ++i){ for(int j = 1; j <= m; ++j){ cin >> a[i][j]; } } long long ans = 0; for(int j = m; j >= 1; --j){ int sum = 0; for(int i = 1; i <= n; ++i){ if(a[i][j] == 'J'){ sum += f[i]; } else if(a[i][j] == 'O'){ ++f[i]; } else{ ans += sum; } } } cout << ans << '\n'; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...