Advertisement
Guest User

952

a guest
Feb 18th, 2020
88
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 1.10 KB | None | 0 0
  1. #include <bits/stdc++.h>
  2.  
  3. using namespace std;
  4. ifstream in("suprasolicitare.in");
  5. ofstream out("suprasolicitare.out");
  6. int n,v[102][102],r[102],c[102],xSt,ySt;
  7. unordered_map<string,pair<int,int>> dir;
  8. void read(){
  9.     in>>n;
  10.     for(int i = 1; i <= n; ++i){
  11.         for(int j = 1; j <= n ;++j){
  12.             in>>v[i][j];
  13.             if(v[i][j] == 1){
  14.                 r[i] = true;
  15.                 c[j] = true;
  16.             }
  17.         }
  18.     }
  19.     in>>xSt>>ySt;
  20. }
  21. void lee(){
  22.     int dx[] = {-1,0,1,0};
  23.     int dy[] = {0,1,0,-1};
  24.     queue<pair<int,int>> coord;
  25.     queue<vector<string>> comanda;
  26.     vector<string> x;
  27.     coord.push({xSt,ySt}); x = {"Sus"}; comanda.push(x);
  28.     coord.push({xSt,ySt}); x = {"Jos"}; comanda.push(x);
  29.     coord.push({xSt,ySt}); x = {"Dreapta"}; comanda.push(x);
  30.     coord.push({xSt,ySt}); x = {"Stanga"}; comanda.push(x);
  31.     dir["Sus"] = {-1,0};
  32.     dir["Jos"] = {1,0};
  33.     dir["Dreapta"] = {0,1};
  34.     dir["Stanga"] = {0,-1};
  35.     while(!coord.empty()){
  36.  
  37.         coord.pop();
  38.         comanda.pop();
  39.     }
  40. }
  41. int main()
  42. {
  43.     read();
  44.     lee();
  45.     return 0;
  46. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement