Submission #1266430

#TimeUsernameProblemLanguageResultExecution timeMemory
1266430canhnam357Bold (COCI21_bold)C++20
50 / 50
1 ms328 KiB
// source problem : 
#include <bits/stdc++.h>
using namespace std;
#define all(x) x.begin(), x.end()
#define int long long
#define lb lower_bound
#define ub upper_bound
#define MASK(i) (1LL << (i))
const int inf = 1e18;
void ckmax(int& f, int s)
{
    f = (f > s ? f : s);
}
void ckmin(int& f, int s)
{
    f = (f < s ? f : s);
}
int32_t main()
{
    ios_base::sync_with_stdio(false);
    cin.tie(0);
    int n, m;
    cin >> n >> m;
    vector<string> a(n);
    for (string &S : a) cin >> S;
    auto b = a;
    for (int i = 0; i + 1 < n; i++) {
        for (int j = 0; j + 1 < m; j++) {
            if (a[i][j] == '#') {
                b[i][j] = b[i + 1][j] = b[i][j + 1] = b[i + 1][j + 1] = '#';
            }
        }
    }   
    for (string s : b) cout << s << '\n';
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...