#include<bits/stdc++.h>
#define eps 1e-9
#define MOD1 998244353
#define MOD2 1000000007
#define INV_2 499122177
#define INF 1000000000
#define PI 3.14159265358979323846
using namespace std;
int main()
{
ios::sync_with_stdio(0);cin.tie(0);cout.tie(0);
int n, m;
cin >> n >> m;
char a[m][n], b[m][n];
for(int i = 0; i <n; i++)
for(int j = 0; j < m; j++)
b[j][i]='.';
for(int i = 0; i <n; i++)
{
for(int j = 0; j < m; j++)
{
cin >> a[j][i];
if(a[j][i]=='#')
{
b[j][i]='#';
b[j+1][i]='#';
b[j][i+1]='#';
b[j+1][i+1]='#';
}
}
}
for(int i = 0; i <n; i++)
{
for(int j = 0; j < m; j++)
cout << b[j][i];
cout << '\n';
}
}
//size
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
204 KB |
Output is correct |
2 |
Correct |
1 ms |
204 KB |
Output is correct |
3 |
Correct |
1 ms |
204 KB |
Output is correct |
4 |
Correct |
1 ms |
312 KB |
Output is correct |
5 |
Correct |
1 ms |
204 KB |
Output is correct |