#include <bits/stdc++.h>
using namespace std;
int n, m;
char in[100][100], out[100][100];
int main() {
cin >> n >> m;
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cin >> in[i][j];
out[i][j] = '.';
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
if (in[i][j] == '#') {
out[i][j] = '#';
out[i][j + 1] = '#';
out[i + 1][j] = '#';
out[i + 1][j + 1] = '#';
}
}
}
for (int i = 0; i < n; i++) {
for (int j = 0; j < m; j++) {
cout << out[i][j];
}
cout << '\n';
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
364 KB |
Output is correct |
2 |
Correct |
1 ms |
384 KB |
Output is correct |
3 |
Correct |
1 ms |
364 KB |
Output is correct |
4 |
Correct |
1 ms |
364 KB |
Output is correct |
5 |
Correct |
1 ms |
364 KB |
Output is correct |