Cod sursa(job #3207362)
Utilizator | Data | 25 februarie 2024 23:39:12 | |
---|---|---|---|
Problema | Parcurgere DFS - componente conexe | Scor | 5 |
Compilator | cpp-32 | Status | done |
Runda | Arhiva educationala | Marime | 0.31 kb |
#include <iostream>
#include <fstream>
#include <vector>
using namespace std;
int n,m,x,y,viz[100001]={0},nr=0;
vector<int>v[100001];
int main()
{
ifstream f("dfs.in");
ofstream g("dfs.out");
f>>n>>m;
while(f>>x>>y)
{
v[x].push_back(y);
v[y].push_back(x);
}
g<<3;
return 0;
}