Vertex Cover
Easy
Execution time limit is 1 second
Runtime memory usage limit is 128 megabytes
You are given an unweighted, undirected tree. Write a program to find a vertex set of minimum size in this tree such that each edge has as least one of its end-points in that set.
Input
The first line contains one integer — number of nodes in the tree. Next lines contain edges of that tree. Each line contains a pair means there is an edge between node and node .
Output
Print number of nodes in the satisfied vertex set on one line.
Examples
Input #1
Answer #1
Submissions 9K
Acceptance rate 23%