# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
210325 | aloomya | Emacs (COCI20_emacs) | C++14 | 0 ms | 0 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> using namespace std; #define int long long #define pb push_back #define pf push_front #define pob pop_back #define pof pop_front #define F first #define S second typedef pair<int, int> PII; const int KMX = 1e2 + 10, MOD = 1e9 + 7, inf = 3e18, ninf = -3e18; string s[KMX]; int32_t main(){ ios_base::sync_with_stdio(false); cin.tie(); int n, m; cin >> n >> m; for(int i = 0; i < n; i++){ cin >> s[i]; } int ans = 0; for(int i = 0; i < n; i++){ for(int j = 0; j < m ; j++){ bool tf = (s[i][j] == '*'); tf &= (j ? s[i][j - 1] == '.' : 1); tf &= (i ? s[i - 1][j] == '.' : 1); if(tf) ans++; } } cout << ans << endl; }