https://www.lanqiao.cn/problems/602/learning/?page=1&first_category_id=1&name=%E8%BF%B7%E5%AE%AB
#include <bits/stdc++.h>
#define int long long
#define xx first
#define yy second
using namespace std;
const int N = 110;
typedef pair<int , int> PII;
queue<PII> q;
int n, m, a, b, c, h;
char g[N][N];
char path[4] = {'D','L','R','U'};
string path_str[50][50];
int d[N][N];
int bfs() {
memset(d, -1, sizeof(d));
d[1][1] = 0;
int dx[4] = {1,0,0,-1}, dy[4] = {0,-1,1,0 };
while (q.size()) {
auto t = q.front();
q.pop();
for (int i = 0; i < 4; i++) {
int x = t.first + dx[i];
int y = t.second + dy[i];
if (x >= 1 && x <= n && y >= 1 && y <= m && g[x][y] == '0' && d[x][y] == -1) {
d[x][y] = d[t.xx][t.yy] + 1;
q.push({x, y});
path_str[x][y] = path_str[t.first][t.second] + path[i];
if (x == n && m == y) return d[x][y];
}
}
}
return -1;
}
void solve() {
cin>>n>>m;
for (int i = 1; i <= n; i++)
for (int j = 1; j <= m; j++)
cin >> g[i][j];
q.push({1,1});
bfs();
cout<<path_str[n][m]<<endl;
}
signed main() {
int t = 1;
//cin >> t;
//while (t--) solve();
cout<<"DDDDRRURRRRRRDRRRRDDDLDDRDDDDDDDDDDDDRDDRRRURRUURRDDDDRDRRRRRRDRRURRDDDRRRRUURUUUUUUULULLUUUURRRRUULLLUUUULLUUULUURRURRURURRRDDRRRRRDDRRDDLLLDDRRDDRDDLDDDLLDDLLLDLDDDLDDRRRRRRRRRDDDDDDRR"<<endl;
return 0;
} [](http://)