Submission #500563

#TimeUsernameProblemLanguageResultExecution timeMemory
500563noNickmanEmacs (COCI20_emacs)C++14
25 / 50
1 ms300 KiB
#include <bits/stdc++.h> using namespace std; int main(){ int n,m; cin >> n >> m; char a[n][m]; int ans=0; if(n == 1){ for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin >> a[i][j]; } } for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ if(a[i][j] == '*' && a[i][j+1] != '*') ans++; } } cout << ans << '\n'; } else{ for(int i=0;i<n;i++){ for(int j=0;j<m;j++){ cin >> a[i][j]; if(a[i][j] == '*') ans++; } } cout << ans << '\n'; } }
#Verdict Execution timeMemoryGrader output
Fetching results...