Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include<bits/stdc++.h>
- #define ll long long
- #define N ((int)6e4 + 5)
- #define MOD ((int)1e9 + 7)
- #define MAX ((int)1e9 + 7)
- #define MAXL ((ll)1e18 + 7)
- #define MAXP ((int)1e3 + 7)
- #define thr 1e-8
- #define pi acos(-1) /// pi = acos ( -1 )
- #define fastio ios_base::sync_with_stdio(false),cin.tie(NULL)
- #define endl "\n"
- using namespace std;
- string dir;
- int dxx[] = {1 , 0 , 0 , -1};
- int dyy[] = {0 , -1 , 1 , 0};
- pair < int , int > des;
- string dfs(int row , int col , int rem)
- {
- if(rem == 0) return "";
- for(int i = 0 ; i < 4 ; i++){
- int x = row + dxx[i] , y = col + dyy[i];
- if(IsValid(x, y) && dis[x][y] <= rem){
- return dir[i] + dfs(x , y , rem-1);
- }
- }
- return "IMPOSSIBLE";
- }
- void bfs(int row , int col)
- {
- /// bfs
- }
- int main(){
- dir = "DLRU";
- for(int i = 0 ; i < n ; i++) cin>>str[i];
- for(int i = 0 ; i < n ; i++){
- for(int j = 0 ; j < m ; j++){
- if(str[i][j] == 'X'){
- bfs(i,j);
- cout<<dfs(i,j,k)<<endl;
- return 0;
- }
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement