Submission #236431

#TimeUsernameProblemLanguageResultExecution timeMemory
236431vO_OvEmacs (COCI20_emacs)C++14
50 / 50
8 ms6528 KiB
// 失敗するからこそ そこから立ち向かって行く強さがあってそんな強さが本当の強さだと私は思うから #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
#Verdict Execution timeMemoryGrader output
Fetching results...