Advertisement
Guest User

Untitled

a guest
Sep 19th, 2019
130
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.76 KB | None | 0 0
  1. /*
  2.  
  3. ∧_∧
  4. ( ・ω・。)つ━☆・*。
  5. ⊂  ノ    ・゜
  6. しーJ   Accepted
  7.  
  8. */
  9.  
  10. // #pragma GCC optimize("O3")
  11. // #pragma GCC target("sse,sse2,sse3,ssse3,sse4,popcnt,abm,mmx,avx,tune=native")
  12.  
  13. #include<bits/stdc++.h>
  14. #include <ext/pb_ds/assoc_container.hpp>
  15. #include <ext/pb_ds/tree_policy.hpp>
  16.  
  17. #define ll long long
  18. #define all(x) begin(x), end(x)
  19. #define x first
  20. #define y second
  21. #define int long long
  22.  
  23. using namespace std;
  24. using namespace __gnu_pbds;
  25.  
  26. typedef pair<int, int> pii;
  27. typedef long double ld;
  28. template<typename T>
  29. using kawaii_set = tree<T, null_type, less<T>, rb_tree_tag, tree_order_statistics_node_update>;
  30.  
  31. const ld PI = atan2(0, -1);
  32.  
  33. void seriy() {
  34. ios::sync_with_stdio(0);
  35. cin.tie(0);
  36. cout.tie(0);
  37. cout << fixed << setprecision(14);
  38. #ifdef _offline
  39. freopen("input.txt", "r", stdin);
  40. freopen("output.txt", "w", stdout);
  41. #endif
  42. }
  43.  
  44. const int MAXN = 1e5 + 10;
  45. const int MAXM = 600;
  46. const int INF = INT_MAX;
  47. const int MOD = 1e9 + 7;
  48. const int MAXLOG = 61;
  49.  
  50. vector<vector<char>> res;
  51. int dx[4] = {-1, 1, 0, 0};
  52. int dy[4] = {0, 0, -1, 1};
  53. int d;
  54.  
  55. bool cor(int x, int y) {
  56. return x > -1 && x < res.size() && y > -1 && y < res[0].size();
  57. }
  58.  
  59. signed main() {
  60. seriy();
  61. int k;
  62. cin >> k >> d;
  63. d--;
  64. int w, h;
  65. cin >> w >> h;
  66. int n;
  67. cin >> n;
  68. vector<vector<char>> kek(((h - 1) * (k - 1) + h), vector<char>((w - 1) * (k - 1) + w, '.'));
  69. vector<vector<int>> lol(((h - 1) * (k - 1) + h), vector<int>((w - 1) * (k - 1) + w, -1));
  70. for(int i = 0; i < n; i++) {
  71. int x1, y1, x2, y2;
  72. cin >> y1 >> x1 >> y2 >> x2;
  73. x1 *= k;
  74. x2 *= k;
  75. y1 *= k;
  76. y2 *= k;
  77. if(x1 == x2) {
  78. if(y1 > y2) {
  79. swap(y1, y2);
  80. }
  81. for(int j = y1; j <= y2; j++) {
  82. lol[x1][j] = 0;
  83. kek[x1][j] = '*';
  84. }
  85. }
  86. else if(y1 == y2) {
  87. if(x1 > x2) {
  88. swap(x1, x2);
  89. }
  90. for(int j = x1; j <= x2; j++) {
  91. lol[j][y1] = 1;
  92. kek[j][y1] = '*';
  93. }
  94. }
  95. else {
  96. if(y1 > y2) {
  97. swap(x1, x2);
  98. swap(y1, y2);
  99. }
  100. if(x1 > x2) {
  101. for(int j = 0; j <= y2 - y1; j++) {
  102. lol[x1 - j][y1 + j] = 2;
  103. kek[x1 - j][y1 + j] = '*';
  104. }
  105. }
  106. else {
  107. for(int j = 0; j <= y2 - y1; j++) {
  108. lol[x1 + j][y1 + j] = 2;
  109. kek[x1 + j][y1 + j] = '*';
  110. }
  111. }
  112. }
  113. }
  114. return 0;
  115. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement