답안 #486444

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
486444 2021-11-11T16:57:41 Z davi_bart Bold (COCI21_bold) C++17
50 / 50
1 ms 204 KB
#pragma GCC optimize("O3")
#include <bits/stdc++.h>
using namespace std;
#define ll long long
#define int ll
#define fi first
#define se second
#define ld long double
#define pb push_back
mt19937 rng(chrono::steady_clock::now().time_since_epoch().count());
signed main() {
    ios::sync_with_stdio(false);
    cin.tie(0);
    int N, M;
    cin >> N >> M;
    char a[N][M];
    for (int i = 0; i < N; i++) {
        string h;
        cin >> h;
        for (int j = 0; j < M; j++) {
            a[i][j] = h[j];
        }
    }
    for (int i = N - 2; i >= 0; i--) {
        for (int j = M - 2; j >= 0; j--) {
            if (a[i][j] == '#') {
                a[i + 1][j + 1] = '#';
                a[i + 1][j] = '#';
                a[i][j + 1] = '#';
            }
        }
    }
    for (int i = 0; i < N; i++) {
        for (int j = 0; j < M; j++) {
            cout << a[i][j];
        }
        cout << endl;
    }
}
# 결과 실행 시간 메모리 Grader output
1 Correct 1 ms 204 KB Output is correct
2 Correct 0 ms 204 KB Output is correct
3 Correct 0 ms 204 KB Output is correct
4 Correct 1 ms 204 KB Output is correct
5 Correct 0 ms 204 KB Output is correct