func_code_string: #include <bits/stdc++.h>   using namespace std;   int n, m, x, y;   string s;   bool v[505][505];   bool judge(int x, int y) { return (x >= 1 && x <= n && y >= 1 && y <= m); }   int dirx(char x) {     if (x ==  L  || x ==  R ) return 0;     if (x ==  U ) return -1;     return 1;   }   int diry(char x) {     if (x ==  U  || x ==  D ) return 0;     if (x ==  L ) return -1;     return 1;   }   int main() {     cin >> n >> m >> x >> y;     cin >> s;     int len = (int)s.length();     int nx, ny;     v[x][y] = true;     printf( 1  );     for (int i = 0; i < len - 1; ++i) {       nx = x + dirx(s[i]);       ny = y + diry(s[i]);       if (!judge(nx, ny)) {         printf( 0  );         continue;       }       x = nx;       y = ny;       if (v[x][y])         printf( 0  );       else {         v[x][y] = true;         printf( 1  );       }     }     int ans = 0;     for (int i = 1; i <= n; ++i) {       for (int j = 1; j <= m; ++j) {         if (!v[i][j]) ans++;       }     }     cout << ans << endl;     return 0;   }   