Submission #888262

#TimeUsernameProblemLanguageResultExecution timeMemory
888262Marco_EscandonBitaro the Brave (JOI19_ho_t1)C++11
100 / 100
214 ms18004 KiB
#include<bits/stdc++.h> using namespace std; #define optimizar_io ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);cout.setf(ios::fixed);cout.precision(0); #pragma GCC optimize("Ofast") typedef long long ll; #define double long double int main() { optimizar_io ll n,m; cin>>n>>m; char cad[n][m]; ll I[m]={ },O[n]={ }; for(int i=0; i<n; i++) { for(int j=0; j<m; j++) { cin>>cad[i][j]; if(cad[i][j]=='O') O[i]++; if(cad[i][j]=='I') I[j]++; } } ll cont=0; for(int i=0; i<n; i++) { for(int j=0; j<m; j++) { if(cad[i][j]=='J') cont+=(O[i]*I[j]); if(cad[i][j]=='O') O[i]--; if(cad[i][j]=='I') I[j]--; } } cout<<cont; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...