Cod sursa(job #1698406)
| Utilizator | Data | 4 mai 2016 12:50:55 | |
|---|---|---|---|
| Problema | BFS - Parcurgere in latime | Scor | 0 |
| Compilator | cpp | Status | done |
| Runda | Arhiva educationala | Marime | 0.58 kb |
#include <fstream>
#include <vector>
#include <queue>
using namespace std;
ifstream fin("bfs.in");
ofstream fout("bfs.out");
struct nod
{
vector <int> v;
bool viz=false;
};
nod a[100000];
queue <nod> q;
int bfs[100000];
int main()
{
int n, m, s;
fin >> n >> m >> s;
for(int i=1; i<=m; i++)
{
int ct, vec;
fin >> ct >> vec;
a[ct].v.push_back(vec);
}
q.push(a[s]);
a[s].viz=true;
int ct;
while(!q.empty())
{
ct=q.front(); q.pop();
}
return 0;
}
