{"problem":{"name":"Star or Not","description":{"content":"You are given a tree with $N$ vertices and $N-1$ edges.   The vertices are numbered $1,2,\\ldots,N$. The $i$\\-th edge connects Vertex $a_i$ and Vertex $b_i$. Determine whether this tree is a star. Here","description_type":"Markdown"},"platform":"AtCoder","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"abc225_b"},"statements":[{"statement_type":"Markdown","content":"You are given a tree with $N$ vertices and $N-1$ edges.  \nThe vertices are numbered $1,2,\\ldots,N$. The $i$\\-th edge connects Vertex $a_i$ and Vertex $b_i$.\nDetermine whether this tree is a star.\nHere, a star is a tree where there is a vertex directly connected to all other vertices.\n\n## Constraints\n\n*   $3 \\leq N \\leq 10^5$\n*   $1 \\leq a_i \\lt b_i \\leq N$\n*   The given graph is a tree.\n\n## Input\n\nInput is given from Standard Input in the following format:\n\n$N$\n$a_1$ $b_1$\n$\\vdots$\n$a_{N-1}$ $b_{N-1}$\n\n[samples]\n\n## Notes\n\nFor the definition of a tree, see [Tree (graph theory) - Wikipedia](https://en.wikipedia.org/wiki/Tree_(graph_theory)).","is_translate":false,"language":"English"}],"meta":{"iden":"abc225_b","tags":[],"sample_group":[["5\n1 4\n2 4\n3 4\n4 5","Yes\n\nThe given graph is a star."],["4\n2 4\n1 4\n2 3","No\n\nThe given graph is not a star."],["10\n9 10\n3 10\n4 10\n8 10\n1 10\n2 10\n7 10\n6 10\n5 10","Yes"]],"created_at":"2026-03-03 11:01:13"}}