Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- #define taskname "bando"
- typedef long long ll;
- void ioset() {
- cin.tie(0)->sync_with_stdio(0);
- if (fopen(taskname".inp", "r")) {
- freopen(taskname".inp", "r", stdin);
- // freopen(taskname".out", "w", stdout);
- }
- }
- const int N = 1005 * 2;
- int n, m, a[N][N];
- int sx, sy, tx, ty;
- void solve() {
- cin >> n >> m >> sx >> sy >> tx >> ty;
- sx *= 2; sy *= 2; tx *= 2; ty *= 2;
- for (int i = 1; i <= n * 2 + 1; i++) {
- a[i][1] = a[i][m * 2 + 1] = 1;
- }
- for (int i = 1; i <= m * 2 + 1; i++) {
- a[1][i] = a[n * 2 + 1][i] = 1;
- }
- for (int i = 1; i <= n * 2 + 1; i += 2)
- for (int j = 1; j <= m * 2 + 1; j += 2) {
- if (i % 2 || j % 2) a[i][j] = 1;
- }
- for (int i = 2; i <= n * 2; i += 2)
- for (int j = 2; j <= m * 2; j += 2) {
- int x; cin >> x;
- if (x == 1) {
- a[i][j + 1] = 1;
- }
- else if (x == 2) {
- a[i + 1][j] = 1;
- }
- else if (x == 3) {
- a[i][j + 1] = 1;
- a[i + 1][j] = 1;
- }
- }
- for (int i = 1; i <= n * 2 + 1; i++)
- for (int j = 1; j <= m * 2 + 1; j++) {
- if (i % 2 == 0 && j % 2 == 0) {
- cout << " ";
- }
- else cout << a[i][j] << ' ';
- if (j == m * 2 + 1) cout << '\n';
- }
- }
- int main() {
- ioset();
- solve();
- }
Add Comment
Please, Sign In to add comment