Pro.ID21832 TitleArrest Title链接http://10.20.2.8/oj/exercise/problem?problem_id=21832 AC0 Submit0 Ratio- 时间&空间限制描述Country ALPC has n cities, and the cities are connected by undirected roads. Furthermore, there is exactly one route between each pair of cities. Now some criminals break the prison and the police do not know where they are. And the criminals can stay in a city or move on the roads. The police office has made a decision to send policemen to arrest the breakers. If a police and a criminal at a same point at the same time the criminal is under arrest, no matter in a city or on a road. The police office wants to minimize the number of policemen to arrest all the criminals. Now the map of Country ALPC is given, please tell the police office the least number of policemen required. 输入There are several test cases. The first line a integer n, the number of cities. Next n-1 lines each two integers a and b, there is a road between city a and city b. ( 1 ≤ n ≤ 1000 , 1 ≤ a, b ≤ n ) 输出Description Country ALPC has n cities, and the cities are connected by undirected roads. Furthermore, there is exactly one route between each pair of cities. Now some criminals break the prison and the police do not know where they are. And the criminals can stay in a city or move on the roads. The police office has made a decision to send policemen to arrest the breakers. If a police and a criminal at a same point at the same time the criminal is under arrest, no matter in a city or on a road. The police office wants to minimize the number of policemen to arrest all the criminals. Now the map of Country ALPC is given, please tell the police office the least number of policemen required. Input There are several test cases. The first line a integer n, the number of cities. Next n-1 lines each two integers a and b, there is a road between city a and city b. ( 1 ≤ n ≤ 1000 , 1 ≤ a, b ≤ n ) Output For each case output the minimal number of policemen. Sample Input 3 Sample Output 1 Source 样例输入3 样例输出1 作者 |