Leaves - MarisaOJ: Marisa Online Judge

Leaves

Time limit: 1000 ms
Memory limit: 256 MB
Given a tree of $n$ vertices. You can choose the root arbitrarily, find the maximum number of leaves in the tree. ### Input - The first line contains an integers $n$. - The next $n - 1$ lines, each line contains two integers $u,v$, there is an edge between $u$ and $v$. ### Output - Print the maximum number of leaves. ### Constraints - $1 \le n \le 10^5$. - $1 \le u, v \le n$. ### Example Input: ``` 3 1 2 1 3 ``` Output: ``` 2 ```