# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
440597 | RaadSharar777 | Emacs (COCI20_emacs) | C++17 | 1 ms | 204 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<stdio.h>
#include<stdlib.h>
#include<iostream>
#include<vector>
#include<algorithm>
#include<math.h>
#include<string.h>
#include<utility>
using namespace std;
int main(){
int n,m;
cin >> n >> m;
char grid[n+2][m+2];
memset(grid,0,sizeof grid);
for (int i = 1; i <= n; i++) {
string k;
cin >> k;
for (int j = 1; j <= m; j++){
grid[i][j] = k[j-1];
}
}
int sum = 0;
for(int i = 1; i <= n; i++){
for(int j = 1; j <= n; j++){
if(grid[i][j] == '*' && grid[i-1][j]!= '*' && grid[i][j-1]!= '*' && grid[i-1][j-1]!= '*')
sum++;
}
}
cout << sum << endl;
}
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |