Codeforces Round #192 (Div. 2) A. Cakeminator

OpenSoucre發表於2013-07-21
 1 #include <iostream>
 2 #include <vector>
 3 using namespace std;
 4 
 5 int main(){
 6     int r,c;
 7     cin >>r>>c;
 8     vector<bool> row(r,false),col(c,false);
 9     char ch;
10     for(int i = 0 ; i < r; i ++ ){
11         for(int j = 0 ; j < c; j ++){
12             cin >> ch;
13             if(ch == 'S') row[i] = col[j] = true;
14         }
15     }
16     int cnt = 0;
17     for(int i = 0 ; i < r; i ++){
18         for(int j = 0 ; j < c; j ++ ){
19             if(!row[i] || ! col[j] ) cnt++;
20         }
21     }
22     cout<<cnt<<endl;
23     return 0;
24 }

 

相關文章