Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #pragma GCC optimize("O3")
- #include<bits/stdc++.h>
- #include <ext/pb_ds/detail/standard_policies.hpp>
- #include <ext/pb_ds/assoc_container.hpp>
- #include <ext/pb_ds/tree_policy.hpp>
- #define ll long long
- #define f first
- #define die exit(0)
- #define s second
- #define pb push_back
- #define pf push_front
- #define pp pop_back
- #define ld long double
- #define durka main
- using namespace std;
- using namespace __gnu_pbds;
- typedef tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
- mt19937 gen(time(0));
- /// system("cls");
- /// char(219) - квадрат
- /// 176: ░
- ///177: ▒
- ///178: ▓
- int32_t main()
- {
- ios_base::sync_with_stdio(0);
- cin.tie(0);
- cout.tie(0);
- pair<ll,ll> a[60][60];
- for(int i = 0; i < 20; i++) {
- for(int j= 0; j < 20; j++) {
- a[i][j] = {0, gen() % 2 + 1};
- }
- }
- ll x, y;
- cin >> x >> y;
- a[x][y] = {1, 1};
- ll tr;
- cin >> tr;
- for(int q = 1; q <= tr; q++) {
- system("cls");
- if(q - 1) for(int i = 0; i < 20; i++) {
- for(int j= 0; j < 20; j++) {
- if(a[i][j].f == q) if(a[i][j].s == 1) cout << char(219);
- else cout << char(176);
- else if(q - a[i][j].f <= 3) cout << char(178 - (q - a[i][j].f) + 1);
- else cout << " ";
- }
- cout << endl;
- }
- for(int i = 0; i < 20; i++) {
- for(int j= 0; j < 20; j++) {
- if(a[i][j].f == q) {
- ll ko = 2;
- if(i && gen() % 4 == 0 && ko)
- if((a[i - 1][j].s == a[i][j].f) ||
- (gen() % 2 == 0)) a[i - 1][j].f = q + 1, a[i - 1][j].s = a[i][j].s, ko--;
- if(j && gen() % 4 == 0 && ko)
- if((a[i][j - 1].s == a[i][j].f) ||
- (gen() % 2 == 0))a[i][j - 1].f = q + 1,a[i][j - 1].s = a[i][j].s, ko--;
- if(i < 19 && gen() % 4 == 0 && ko)
- if((a[i + 1][j].s == a[i][j].f) ||
- (gen() % 2 == 0))a[i + 1][j].f = q + 1, a[i + 1][j].s = a[i][j].s, ko--;
- if(gen() % 4 == 0 && ko)
- if(j < 19 && (a[i][j + 1].s == a[i][j].f) ||
- (gen() % 2 == 0)) a[i][j + 1].f = q + 1, a[i][j + 1].s = a[i][j].s, ko--;
- if(ko == 2) a[i][j].f = q + 1;
- }
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement