1 /* ARTICULATION POINTS */
19 #define forn(i, n) for(int i=0;i<int(n);i++)
20 #define FOR(i, a, b) for(int i=(a);i<int(b);i++)
21 #define RFOR(i, b, a) for(int i=(b);i>int(a);i--)
22 #define foreach(it, c) for(__typeof((c).begin()) it = (c).begin();it!=(c).end();++it)
23 #define ALL(x) (x).begin(),(x).end()
24 #define SIZE(x) (int)(x).size()
25 #define SORT(x) sort(ALL(x))
27 #define VI vector<int>
28 #define VS vector<string>
30 #define ISS istringstream
31 #define OSS ostringstream
33 // NUNCA DEFINIR int max....
35 vector
<int> edges
[101];
37 int id
[101], color
[101];
39 int back(int node
, int father
){
45 bool isArt
= false;int aux
;
46 for(i
=0;i
<edges
[node
].size();i
++){
47 int v
= edges
[node
][i
];
48 if( v
== father
)continue;
50 cant
++, aux
= back(v
,node
);
51 if( aux
>= id
[node
] ) isArt
= true;
53 low
= min ( low
, aux
);
55 if( node
== 1 )if( cant
> 1 )res
++;
64 scanf("%i", &N
); if(!N
) return 0;
65 while(getchar() !='\n' ) ;
66 for(i
=1;i
<=N
;i
++) edges
[i
].clear();
67 memset(mat
, false, sizeof(mat
));
71 istringstream
iss ( s
);
77 edges
[b
].PB(a
), edges
[a
].PB(b
);
78 mat
[a
][b
] = mat
[b
][a
] = true;
82 memset(color
, 0, sizeof(color
));