#include <bits/stdc++.h>
using namespace std;
#define FOR(i, a, b) for(int i = a; i < (b); ++i)
#define all(x) begin(x), end(x)
#define sz(x) (int)(x).size()
#define sqr(x) ((ll)(x))*(x)
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
char letter[102][102];
int N, M;
int main() {
cin >> N >> M;
FOR(y, 0, N) {
letter[0][y+1] = '.';
FOR(x, 0, M) {
cin >> letter[x+1][y+1];
}
}
FOR(x, 0, M) letter[x+1][0] = '.';
FOR(y, 0, N) {
FOR(x, 0, M) {
if (letter[x][y] == '#' or letter[x+1][y] == '#' or
letter[x][y+1] == '#' or letter[x+1][y+1] == '#') cout << "#";
else cout << ".";
}
cout << "\n";
}
}
# |
결과 |
실행 시간 |
메모리 |
Grader output |
1 |
Correct |
1 ms |
308 KB |
Output is correct |
2 |
Correct |
1 ms |
300 KB |
Output is correct |
3 |
Correct |
1 ms |
308 KB |
Output is correct |
4 |
Correct |
1 ms |
212 KB |
Output is correct |
5 |
Correct |
1 ms |
212 KB |
Output is correct |