Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <bits/stdc++.h>
- using namespace std;
- ifstream in("suprasolicitare.in");
- ofstream out("suprasolicitare.out");
- int n,v[102][102],r[102],c[102],xSt,ySt;
- unordered_map<string,pair<int,int>> dir;
- void read(){
- in>>n;
- for(int i = 1; i <= n; ++i){
- for(int j = 1; j <= n ;++j){
- in>>v[i][j];
- if(v[i][j] == 1){
- r[i] = true;
- c[j] = true;
- }
- }
- }
- in>>xSt>>ySt;
- }
- void lee(){
- int dx[] = {-1,0,1,0};
- int dy[] = {0,1,0,-1};
- queue<pair<int,int>> coord;
- queue<vector<string>> comanda;
- vector<string> x;
- coord.push({xSt,ySt}); x = {"Sus"}; comanda.push(x);
- coord.push({xSt,ySt}); x = {"Jos"}; comanda.push(x);
- coord.push({xSt,ySt}); x = {"Dreapta"}; comanda.push(x);
- coord.push({xSt,ySt}); x = {"Stanga"}; comanda.push(x);
- dir["Sus"] = {-1,0};
- dir["Jos"] = {1,0};
- dir["Dreapta"] = {0,1};
- dir["Stanga"] = {0,-1};
- while(!coord.empty()){
- coord.pop();
- comanda.pop();
- }
- }
- int main()
- {
- read();
- lee();
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement