답안 #236431

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
236431 2020-06-02T08:21:06 Z vO_Ov Emacs (COCI20_emacs) C++14
50 / 50
8 ms 6528 KB
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから
#include <bits/stdc++.h>
using namespace std;

template<typename T> ostream& operator<<(ostream &os, const vector<T> &v) { os << '{'; string sep; for (const auto &x : v) os << sep << x, sep = ", "; return os << '}'; }
template<typename T, size_t size> ostream& operator<<(ostream &os, const array<T, size> &arr) { os << '{'; string sep; for (const auto &x : arr) os << sep << x, sep = ", "; return os << '}'; }
template<typename A, typename B> ostream& operator<<(ostream &os, const pair<A, B> &p) { return os << '(' << p.first << ", " << p.second << ')'; }

#define fi first
#define se second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
typedef long long lint;
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());

char grid[2500][2500];
int n, m;


int main() {
    ios::sync_with_stdio(0);
    cin.tie(0);

    memset(grid, '.', sizeof grid);
    cin >> n >> m;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            cin >> grid[i][j];
        }
    }
    int ans = 0;
    for(int i = 0; i < n; i++){
        for(int j = 0; j < m; j++){
            if(grid[i][j] == '*' && grid[i][j + 1] == '.' && grid[i + 1][j] == '.'){
                ans++;
            }
        }
    }

    cout << ans << '\n';
    return 0;
}
// Write Here
# 결과 실행 시간 메모리 Grader output
1 Correct 8 ms 6400 KB Output is correct
2 Correct 8 ms 6400 KB Output is correct
3 Correct 8 ms 6528 KB Output is correct
4 Correct 8 ms 6400 KB Output is correct
5 Correct 8 ms 6400 KB Output is correct
6 Correct 8 ms 6528 KB Output is correct
7 Correct 8 ms 6400 KB Output is correct
8 Correct 8 ms 6528 KB Output is correct
9 Correct 8 ms 6400 KB Output is correct
10 Correct 8 ms 6400 KB Output is correct