## Solución al problema número ArticulationPointsAndBridges de HackerEarth - ArticulationPointsAndBridges.

Cualquier duda no dudes en contactar.

``````#include <bits/stdc++.h>
using namespace std;

vector<pair<int,int> >bridges;
int disc[11],low[11],parent[11],visited[11];

pair<int,int> minmax(int x,int y)
{
pair<int,int> ret;
if(x<y) ret=make_pair(x,y);
else ret=make_pair(y,x);
return ret;
}

void dfs(int vertex,int vistime)
{
visited[vertex]=1;
disc[vertex]=low[vertex]=vistime;
int child=0;
{
child++;
if(parent[vertex]==-1){
if(child>1)
ap.push_back(vertex);
}
ap.push_back(vertex);
}
ap.push_back(vertex);

}

}
int main()
{
int n,m,x,y;
scanf("%d%d",&n,&m);
for(int i=0;i<m;i++){
scanf("%d%d",&x,&y);
}
memset(parent,-1,sizeof(parent));
dfs(0,0);
sort(ap.begin(),ap.end());
sort(bridges.begin(),bridges.end());
printf("%d\n",ap.size());
for(unsigned i=0;i<ap.size();i++) printf("%d ",ap[i]);
printf("\n%d\n",bridges.size());
for(unsigned i=0;i<bridges.size();i++)  printf("%d %d\n", bridges[i].first,bridges[i].second);
return 0;
}
``````