Submission #1271772

#TimeUsernameProblemLanguageResultExecution timeMemory
1271772cbnk32_tuandungBold (COCI21_bold)C++17
50 / 50
0 ms328 KiB
/*  _  _   ___   __  ___  ___  _  _  ___  __   ___     _   _  ___   ___  __   _____  _  _  ___       */
/* | || | /_\ \ / / / __|/ _ \| \| |/ __| \ \ / /_\   | | | |/ _ \ / __| \ \ / / _ \| \| |/ __|      */
/* | __ |/ _ \ V /  \__ \ (_) | .` | (_ |  \ V / _ \  | |_| | (_) | (__   \ V / (_) | .` | (_ |      */
/* |_||_/_/_\_\_|___|___/\___/|_|\_|\___|   \_/_/_\_\ _\___/ \___/ \___| _ \_/_\___/|_|\_|\___| ___  */
/* |   \| __| |_   _| || | /_\ \ / / |   \ / _ \_ _| |  \/  | __| \| | || | |  \/  |/ _ \| \| |/ __| */
/* | |) | _|    | | | __ |/ _ \ V /  | |) | (_) | |  | |\/| | _|| .` | __ | | |\/| | (_) | .` | (_ | */
/* |___/|___|   |_| |_||_/_/ \_\_|   |___/ \___/___| |_|  |_|___|_|\_|_||_| |_|  |_|\___/|_|\_|\___| */

#include <bits/stdc++.h>
using namespace std;
int a[109][109];
int main() {
    ios_base::sync_with_stdio(false);
    cin.tie(NULL); cout.tie(NULL);

    int n,m; cin >> n >> m;
    for (int i = 1; i <= n; ++i) {
    	for (int j = 1; j <= m; ++j) {
    		char x; cin >> x;
    		a[i][j]=x=='#';
    	}
    }
    for (int i = 1; i <= n; ++i) {
    	for (int j = 1; j <= m; ++j) {
    		if (a[i][j]==1) {
    			if (a[i+1][j]==0) a[i+1][j]=2;
    			if (a[i+1][j+1]==0) a[i+1][j+1]=2;
    			if (a[i][j+1]==0) a[i][j+1]=2;
    		}
    	}
    }
    for (int i = 1; i <= n; ++i) {
    	for (int j = 1; j <= m; ++j) {
    		if (a[i][j]) {
    			cout << "#";
    		} else cout << ".";
    	}
    	cout << "\n";
    }
    return 0;
}
#Verdict Execution timeMemoryGrader output
Fetching results...