# | Time | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1172611 | dzhoz0 | Bold (COCI21_bold) | C++20 | 0 ms | 328 KiB |
#include <bits/stdc++.h>
using namespace std;
#define int long long
#define INF 1e18
#define f first
#define s second
#define pii pair<int, int>
#define vi vector<int>
const int MOD = 1'000'000'000 + 7;
void setIO(string name = "")
{
ios_base::sync_with_stdio(0);
cin.tie(0), cout.tie(0);
#ifdef LOCAL
freopen("inp.txt", "r", stdin);
freopen("out.txt", "w", stdout);
#else
if (!name.empty())
{
freopen((name + ".INP").c_str(), "r", stdin);
freopen((name + ".OUT").c_str(), "w", stdout);
}
#endif
}
const int MAXN = 100;
int n, m;
char a[MAXN + 5][MAXN + 5];
char b[MAXN + 5][MAXN + 5];
void solve()
{
cin >> n >> m;
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= m; j++) {
cin >> a[i][j];
b[i][j] = '.';
}
}
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= m; j++) {
if(a[i][j] == '#') {
b[i][j] = '#';
b[i + 1][j] = '#';
b[i][j + 1] = '#';
b[i + 1][j + 1] = '#';
}
}
}
for(int i = 1; i <= n; i++) {
for(int j = 1; j <= m; j++) {
cout << b[i][j];
if(j == m) cout << '\n';
}
}
}
signed main()
{
setIO();
int t = 1;
// cin >> t;
while (t--)
solve();
}
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |