# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
210325 | aloomya | Emacs (COCI20_emacs) | C++14 | 0 ms | 0 KiB |
이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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; }