# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
495253 |
2021-12-18T08:05:43 Z |
kappa |
Bold (COCI21_bold) |
C++14 |
|
1 ms |
316 KB |
#include <bits/stdc++.h>
using namespace std;
int n, m;
char matrix[105][105], mat[105][105];
int main(){
memset(mat, '.', sizeof(mat));
cin >> n >> m;
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
cin >> matrix[i][j];
}
}
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
if(matrix[i][j] == '#'){
n = max(n, i + 2);
m = max(m, j + 2);
mat[i][j] = '#';
mat[i + 1][j] = '#';
mat[i][j + 1] = '#';
mat[i + 1][j + 1] = '#';
}
}
}
cout << "\n";
for (int i = 0; i < n; i++)
{
for (int j = 0; j < m; j++)
{
cout << mat[i][j];
}
cout << "\n";
}
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Correct |
1 ms |
316 KB |
Output is correct |
2 |
Correct |
1 ms |
208 KB |
Output is correct |
3 |
Correct |
1 ms |
316 KB |
Output is correct |
4 |
Correct |
1 ms |
208 KB |
Output is correct |
5 |
Correct |
0 ms |
208 KB |
Output is correct |