Advertisement
Guest User

Untitled

a guest
Mar 28th, 2020
91
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.51 KB | None | 0 0
  1. #pragma GCC optimize("O3")
  2.  
  3.  
  4. #include<bits/stdc++.h>
  5. #include <ext/pb_ds/detail/standard_policies.hpp>
  6. #include <ext/pb_ds/assoc_container.hpp>
  7. #include <ext/pb_ds/tree_policy.hpp>
  8.  
  9.  
  10. #define ll long long
  11. #define f first
  12. #define die exit(0)
  13. #define s second
  14. #define pb push_back
  15. #define pf push_front
  16. #define pp pop_back
  17. #define ld long double
  18. #define durka main
  19. using namespace std;
  20. using namespace __gnu_pbds;
  21.  
  22. typedef tree<pair<ll,ll>, null_type, less<pair<ll,ll>>, rb_tree_tag, tree_order_statistics_node_update> ordered_set;
  23.  
  24. mt19937 gen(time(0));
  25. /// system("cls");
  26. /// char(219) - квадрат
  27. /// 176: ░
  28. ///177: ▒
  29. ///178: ▓
  30. int32_t main()
  31. {
  32.  
  33. ios_base::sync_with_stdio(0);
  34. cin.tie(0);
  35. cout.tie(0);
  36.  
  37.  
  38. pair<ll,ll> a[60][60];
  39. for(int i = 0; i < 20; i++) {
  40. for(int j= 0; j < 20; j++) {
  41. a[i][j] = {0, gen() % 2 + 1};
  42. }
  43. }
  44. ll x, y;
  45. cin >> x >> y;
  46. a[x][y] = {1, 1};
  47.  
  48. ll tr;
  49. cin >> tr;
  50. for(int q = 1; q <= tr; q++) {
  51. system("cls");
  52.  
  53. if(q - 1) for(int i = 0; i < 20; i++) {
  54. for(int j= 0; j < 20; j++) {
  55. if(a[i][j].f == q) if(a[i][j].s == 1) cout << char(219);
  56. else cout << char(176);
  57. else if(q - a[i][j].f <= 3) cout << char(178 - (q - a[i][j].f) + 1);
  58. else cout << " ";
  59. }
  60. cout << endl;
  61. }
  62. for(int i = 0; i < 20; i++) {
  63. for(int j= 0; j < 20; j++) {
  64. if(a[i][j].f == q) {
  65. ll ko = 2;
  66. if(i && gen() % 4 == 0 && ko)
  67. if((a[i - 1][j].s == a[i][j].f) ||
  68. (gen() % 2 == 0)) a[i - 1][j].f = q + 1, a[i - 1][j].s = a[i][j].s, ko--;
  69. if(j && gen() % 4 == 0 && ko)
  70. if((a[i][j - 1].s == a[i][j].f) ||
  71. (gen() % 2 == 0))a[i][j - 1].f = q + 1,a[i][j - 1].s = a[i][j].s, ko--;
  72. if(i < 19 && gen() % 4 == 0 && ko)
  73. if((a[i + 1][j].s == a[i][j].f) ||
  74. (gen() % 2 == 0))a[i + 1][j].f = q + 1, a[i + 1][j].s = a[i][j].s, ko--;
  75. if(gen() % 4 == 0 && ko)
  76. if(j < 19 && (a[i][j + 1].s == a[i][j].f) ||
  77. (gen() % 2 == 0)) a[i][j + 1].f = q + 1, a[i][j + 1].s = a[i][j].s, ko--;
  78.  
  79. if(ko == 2) a[i][j].f = q + 1;
  80.  
  81. }
  82. }
  83. }
  84. }
  85.  
  86.  
  87.  
  88. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement