Submission #495253

#TimeUsernameProblemLanguageResultExecution timeMemory
495253kappaBold (COCI21_bold)C++14
50 / 50
1 ms316 KiB
#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 timeMemoryGrader output
Fetching results...