Submission #1101719

#TimeUsernameProblemLanguageResultExecution timeMemory
1101719EmilPetkovski17Bitaro the Brave (JOI19_ho_t1)C++17
100 / 100
418 ms16124 KiB
#include <iostream> #include <vector> using namespace std; int main() { int n,m; cin>>n>>m; char matrica[n][m]; vector<int> O(n),I(m); for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { char c; cin>>c; matrica[i][j]=c; if(c=='O') { O[i]++; } else if(c=='I') { I[j]++; } } } long long rez=0; for(int i=0;i<n;i++) { for(int j=0;j<m;j++) { if(matrica[i][j]=='J') { rez+=(O[i]*I[j]); } else if(matrica[i][j]=='O') { O[i]--; } else { I[j]--; } } } cout<<rez; }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...