#include <bits/stdc++.h>
#define ll long long int
using namespace std;
const ll N=105;
ll n,m;
char a[N][N];
int main(){
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cin>>n>>m;
for (ll i=1;i<=n;i++)
for (ll j=1;j<=m;j++)
cin>>a[i][j];
for (ll i=n;i>=1;i--)
for (ll j=m;j>=1;j--)
if (a[i][j]=='#'){
a[i+1][j]='#';
a[i][j+1]='#';
a[i+1][j+1]='#';
}
for (ll i=1;i<=n;i++){
for (ll j=1;j<=m;j++)
cout<<a[i][j];
cout<<endl;
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
0 ms |
344 KB |
Output is correct |
2 |
Correct |
0 ms |
604 KB |
Output is correct |
3 |
Correct |
0 ms |
348 KB |
Output is correct |
4 |
Correct |
0 ms |
348 KB |
Output is correct |
5 |
Correct |
0 ms |
348 KB |
Output is correct |