Submission #202791

#TimeUsernameProblemLanguageResultExecution timeMemory
202791mayhoubsalehEmacs (COCI20_emacs)C++14
50 / 50
5 ms380 KiB
#include <bits/stdc++.h> #define pb push_back #define ll long long using namespace std; int n,m; char c[111][111]; int main() { ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0); cin>>n>>m; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ cin>>c[i][j]; } } for(int i=0;i<=n;i++)c[i][0]='.'; for(int i=0;i<=m;i++)c[0][i]='.'; int ans=0; for(int i=1;i<=n;i++){ for(int j=1;j<=m;j++){ if(c[i][j]=='*'&&c[i-1][j]!='*'&&c[i][j-1]!='*')ans++; } } cout<<ans<<endl; return 0; }
#Verdict Execution timeMemoryGrader output
Fetching results...