# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
260524 | kingfran1907 | Emacs (COCI20_emacs) | C++14 | 1 ms | 384 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 <bits/stdc++.h>
#define X first
#define Y second
using namespace std;
typedef long long llint;
const int maxn = 110;
const int base = 31337;
const int mod = 1e9+7;
const int inf = 0x3f3f3f3f;
const int logo = 20;
const int off = 1 << logo;
const int treesiz = off << 1;
int n, m;
char niz[maxn][maxn];
int main() {
scanf("%d%d", &n, &m);
for (int i = 0; i < n; i++)
scanf("%s", niz+i);
int sol = 0;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (niz[i][j] == '*') {
bool flag = true;
if (i > 0 && niz[i - 1][j] == '*') flag = false;
if (j > 0 && niz[i][j - 1] == '*') flag = false;
sol += flag;
}
}
}
printf("%d", sol);
return 0;
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |