#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';
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
292 KB |
Output is correct |
2 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
0 ms |
204 KB |
Output is correct |
5 |
Correct |
0 ms |
204 KB |
Output is correct |
6 |
Correct |
0 ms |
204 KB |
Output is correct |
7 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
8 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |
9 |
Incorrect |
1 ms |
300 KB |
Output isn't correct |
10 |
Incorrect |
1 ms |
204 KB |
Output isn't correct |