Advertisement
Salvens

Untitled

Mar 23rd, 2023
755
0
Never
1
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.87 KB | None | 0 0
  1. #include <algorithm>
  2. #include <iostream>
  3. #include <iomanip>
  4. #include <cmath>
  5. #include <vector>
  6. #include <set>
  7. #include <map>
  8. #include <string>
  9. #include <cassert>
  10. #include <numeric>
  11. #include <queue>
  12. using namespace std;
  13.  
  14. #define int long long
  15. #define IOS ios::sync_with_stdio(false); cin.tie(0); cout.tie(0);
  16.  
  17. const long long INF = 1e18 + 7;
  18. const double EPS = 1e-6;
  19. const int N = 310;
  20. const int MOD = 1e9 + 7;
  21.  
  22. int n, m;
  23.  
  24. void Move(int& x, int& y, string& dir) {
  25.     if (dir == "DL") {
  26.         if (x == n - 1 && y == 0) {
  27.             --x;
  28.             ++y;
  29.             dir = "UR";
  30.             return;
  31.         }
  32.         if (x == n - 1 && y != 0) {
  33.             --x;
  34.             --y;
  35.             dir = "UL";
  36.             return;
  37.         }
  38.         if (x != n - 1 && y == 0) {
  39.             ++x;
  40.             ++y;
  41.             dir = "DR";
  42.             return;
  43.         }
  44.         ++x;
  45.         --y;
  46.     }
  47.     if (dir == "DR") {
  48.         if (x == n - 1 && y == m - 1) {
  49.             --x;
  50.             --y;
  51.             dir = "UL";
  52.             return;
  53.         }
  54.         if (x == n - 1 && y != m - 1) {
  55.             --x;
  56.             ++y;
  57.             dir = "UR";
  58.             return;
  59.         }
  60.         if (x != n - 1 && y == m - 1) {
  61.             ++x;
  62.             --y;
  63.             dir = "DL";
  64.             return;
  65.         }
  66.         ++x;
  67.         ++y;
  68.     }
  69.     if (dir == "UL") {
  70.        
  71.     }
  72. }
  73.  
  74. void solve() {
  75.     int x1, y1, x2, y2;
  76.     cin >> n >> m >> x1 >> y1 >> x2 >> y2;
  77.     --x1, --y1;
  78.     --x2, --y2;
  79.     string dir;
  80.     cin >> dir;
  81.     vector<vector<bool>> used(n, vector<bool>(m, false));
  82.     int cnt = n * m;
  83.     int x = x1, y = y1;
  84.     while (cnt > 0 && (x != x2 || y != y2)) {
  85.         used[x][y] = true;
  86.  
  87.     }
  88. }
  89.  
  90. int32_t main() {
  91.     IOS;
  92.  
  93.     int t = 1;
  94.     cin >> t;
  95.     while (t--) {
  96.         solve();
  97.     }
  98.     return 0;
  99. }
  100.  
  101.  
Advertisement
Comments
  • pchal
    1 year
    Comment was deleted
Add Comment
Please, Sign In to add comment
Advertisement