#include <bits/stdc++.h>
using namespace std;
int main() {
ios_base::sync_with_stdio(false);
cin.tie(nullptr);
int n, m;
cin >> n >> m;
vector<string> a(n);
for (int i = 0; i < n; ++i) {
cin >> a[i];
}
for (int i = n - 2; i >= 0; --i) {
for (int j = m - 2; j >= 0; --j) {
if (a[i][j] == '#') {
a[i][j + 1] = a[i + 1][j + 1] = a[i + 1][j] = '#';
}
}
}
for (int i = 0; i < n; ++i) {
cout << a[i] << '\n';
}
return 0;
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
324 KB |
Output is correct |
2 |
Correct |
0 ms |
212 KB |
Output is correct |
3 |
Correct |
1 ms |
212 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
0 ms |
212 KB |
Output is correct |