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