Submission #210326

#TimeUsernameProblemLanguageResultExecution timeMemory
210326aloomyaEmacs (COCI20_emacs)C++14
50 / 50
5 ms380 KiB
#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; }
#Verdict Execution timeMemoryGrader output
Fetching results...