Cod sursa(job #1351743)

Utilizator cosmin_bobeicaCosmin Bobeica cosmin_bobeica Data 21 februarie 2015 11:29:17
Problema A+B Scor 0
Compilator cpp Status done
Runda Arhiva de probleme Marime 0.93 kb
#include <cstdio>
#include <algorithm>
#include <queue>

using namespace std;

struct alee
{
    int x, y;
};

int mat[180][180];
queue<alee> q;
int n, m;

int dx[] = {0, 1, 0, -1};
int dy[]= {1, 0, -1, 0};

int main()
{
    freopen("/Users/Cosmin/Documents/info/Alee 1/Alee 1/in","r",stdin);
    freopen("/Users/Cosmin/Documents/info/Alee 1/Alee 1/out","w",stdout);
    
    int x, y;
    
    alee start, stop, aux;
    
    scanf("%d%d", &n, &m);
    
    for(int i = 1; i <= m; i++ )
    {
        scanf("%d%d", &x, &y);
        mat[x][y] = -1;
    }
    
    for(int i = 0 ; i <= n+1; i ++)
    {
        mat[0][i] = -1;
        mat[i][0] = -1;
        mat[n + 1][i] = -1;
        mat[i][n + 1] = -1;
    }
    
    scanf("%d%d%d%d", &start.x, &start.y, &stop.x, &stop.y);
    
    q.push(start);
    
    while(!q.empty())
    {
        aux = q.front();
        for(int i = 1; i <= 4; i++)
        {
            
        }
    }
    
    return 0;
}