Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <cmath>
- #include <vector>
- #include <queue>
- #include <algorithm>
- #include <string>
- #include <stack>
- #include <set>
- #include <map>
- #define pii pair <int, int>
- #define pb(x) push_back(x)
- using namespace std;
- using ll = long long;
- using ld = long double;
- using db = double;
- void cv(vector <int> &v) {
- for (auto x : v) cout << x << ' ';
- cout << "\n";
- }
- void cvl(vector <ll> &v) {
- for (auto x : v) cout << x << ' ';
- cout << "\n";
- }
- void cvv(vector <vector <int> > &v) {
- for (auto x : v) cv(x);
- cout << "\n";
- }
- void cvb(vector <bool> v) {
- for (bool x : v) cout << x << ' ';
- cout << "\n";
- }
- void cvs(vector <string> v) {
- for (auto a : v) {
- cout << a << "\n";
- }
- }
- void cvp(vector <pii> a) {
- for (auto p : a) {
- cout << p.first << ' ' << p.second << "\n";
- }
- cout << "\n";
- }
- void cvch(vector <vector <char> > a) {
- for (auto v: a) {
- for (auto i: v) {
- cout << i;
- } cout << "\n";
- } cout << "\n";
- }
- int n, m, inf = 2e9;
- struct rct {
- int x1, x2, y1, y2;
- void upd(int i, int j, int n, int m) {
- int yi = n - 1;
- int xj = j;
- x1 = min(x1, xj);
- x2 = max(x2, xj);
- y1 = min(y1, yi);
- y2 = max(y1, yi);
- }
- };
- rct getrec(vector <vector <int> > a) {
- rct res = {inf, -1, inf, -1};
- for (int i = 0; i < n; ++i) {
- for (int j = 0; j < n; ++j) {
- if (a[i][j] == 0) {
- res.upd(i, j, n, n);
- }
- }
- }
- return res;
- }
- bool in(rct rec, int i, int j) {
- int xj = j;
- int yi = m - 1 - i;
- return xj >= rec.x1
- && xj <= rec.x2
- && yi >= rec.y1
- && yi <= rec.y2;
- }
- bool noout(vector <vector <int> > a, int clr, rct rec) {
- //n m global ok???
- for (int i = 0; i < n; ++i) {
- for (int j = 0; j < m; ++j) {
- if (a[i][j] == clr) {
- if (!in(rec, i, j)) {
- return 0;
- }
- }
- }
- }
- return 1;
- }
- bool gen = 1;
- int main() {
- /*ios::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);*/
- //cin >> n;
- //m = n;
- if (gen) {
- vector <vector <char> > raw(13, vector <char> (13, '.'));
- for (int i = 3; i <= 4; ++i) {
- for (int j = 2; j <= 8; ++j) {
- raw[i][j] = '#';
- }
- }
- for (int i = 5; i <= 8; ++i) {
- for (int j = 2; j <= 4; ++j) {
- raw[i][j] = '#';
- }
- }
- for (int i = 9; i <= 10; ++i) {
- for (int j = 2; j <= 8; ++j) {
- raw[i][j] = '#';
- }
- }
- cvch(raw);
- }
- }
- /*
- .............
- .............
- .............
- ..#######....
- ..#######....
- ..###........
- ..###........
- ..###........
- ..###........
- ..#######....
- ..#######....
- .............
- .............
- */
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement