Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- using namespace std;
- #define fastread()(ios_base::sync_with_stdio(false),cin.tie(NULL));
- int main()
- {
- int m,n,rc=0,cc=0;
- cin>>m>>n;
- int row[m+1],clm[n+1];
- memset(row,0,sizeof(row));
- memset(clm,0,sizeof(clm));
- for(int i=0;i<m;i++)
- {
- for(int j=0;j<n;j++)
- {
- char s;
- cin>>s;
- if(s!='.')
- {
- if(row[i]==0)
- {
- rc++;
- row[i]=1;
- }
- if(clm[j]==0)
- {
- cc++;
- clm[j]=1;
- }
- }
- }
- }
- // cout<<rc<<" "<<cc<<endl;
- /*if(rc*cc>m*n)
- {
- printf("0\n");
- return 0;
- }*/
- printf("%d\n",m*n-rc*cc);
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement