제출 #1355246

#제출 시각아이디문제언어결과실행 시간메모리
1355246vuqar_bazarov1Emacs (COCI20_emacs)C++20
50 / 50
0 ms344 KiB
//***** author: attacker *****//
//***** created: 18.04.2026 21:15:28 *****//

#include <bits/stdc++.h>

using namespace std;

#ifdef LOCAL
#include "algo/debug.h"
#else
#define debug(...) 1
#endif

mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

#define bpc __builtin_popcount
#define size(v) (int) (v.size())

int main() {
  ios_base::sync_with_stdio(false);
  cin.tie(nullptr);
  cout.tie(nullptr);
  int n, m;
  cin >> n >> m;
  vector<string> a(n);
  for (int i = 0; i < n; i++) {
    cin >> a[i];
  }
  int res = 0;
  for (int i = 0; i < n; i++) {
    for (int j = 0; j < m; j++) {
      if ((i == 0 || a[i - 1][j] == '.') && (j == 0 || a[i][j - 1] == '.') && a[i][j] == '*') {
        res++;
      }
    }
  }
  cout << res << '\n';
  return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...