#include <bits/stdc++.h>
using namespace std;
const int MAXN = 1000;
string t[MAXN];
int main() {
int n, m;
cin >> n >> m;
for (int i = 0; i < n; i++) cin >> t[i];
int sol = 0;
for (int i = 0; i < n; i++)
for (int j = 0; j < m; j++)
sol += (i == 0 || t[i - 1][j] == '.') &&
(j == 0 || t[i][j - 1] == '.') &&
t[i][j] == '*';
cout << sol << "\n";
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
5 ms |
376 KB |
Output is correct |
2 |
Correct |
5 ms |
376 KB |
Output is correct |
3 |
Correct |
5 ms |
380 KB |
Output is correct |
4 |
Correct |
5 ms |
376 KB |
Output is correct |
5 |
Correct |
5 ms |
376 KB |
Output is correct |
6 |
Correct |
5 ms |
376 KB |
Output is correct |
7 |
Correct |
5 ms |
376 KB |
Output is correct |
8 |
Correct |
5 ms |
376 KB |
Output is correct |
9 |
Correct |
5 ms |
376 KB |
Output is correct |
10 |
Correct |
5 ms |
376 KB |
Output is correct |