{"trustable":false,"prependHtml":"\u003cstyle type\u003d\u0027text/css\u0027\u003e\n .input, .output {\n border: 1px solid #888888;\n }\n .output {\n margin-bottom: 1em;\n position: relative;\n top: -1px;\n }\n .output pre, .input pre {\n background-color: #EFEFEF;\n line-height: 1.25em;\n margin: 0;\n padding: 0.25em;\n }\n \u003c/style\u003e\n \u003clink rel\u003d\"stylesheet\" href\u003d\"//codeforces.org/s/96598/css/problem-statement.css\" type\u003d\"text/css\" /\u003e\u003cscript\u003e window.katexOptions \u003d { disable: true }; \u003c/script\u003e\n\u003cscript type\u003d\"text/x-mathjax-config\"\u003e\n MathJax.Hub.Config({\n tex2jax: {\n inlineMath: [[\u0027$$$\u0027,\u0027$$$\u0027], [\u0027$\u0027,\u0027$\u0027]],\n displayMath: [[\u0027$$$$$$\u0027,\u0027$$$$$$\u0027], [\u0027$$\u0027,\u0027$$\u0027]]\n }\n });\n\u003c/script\u003e\n\u003cscript type\u003d\"text/javascript\" async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS_HTML-full\"\u003e\u003c/script\u003e","sections":[{"title":"题目描述","value":{"format":"MD","content":"众所周知,条条大路通罗马。\n\nTXT 所在的地区有 $n$ 个城市,通过 $n - 1$ 条单向道路连接。\n\n显然,如果我们不考虑道路的方向,我们可以从任何一个城市到达任何其他城市。\n\n如果选择城市 $a$ 作为罗马,那么我们应该可以从城市 $a$ 到达任何其他城市。\n\n为了达到上面的条件,我们可能需要反转一些道路的方向。\n\n现在 TXT 想知道,选择哪个城市 $a$ 作为罗马,需要反转的道路数量最少。"}},{"title":"输入格式","value":{"format":"MD","content":"第一行输入包含整数 $n$ ($2 \\leq n \\leq 2 \\cdot 10^5$) —— 城市数量。\n\n接下来的 $n - 1$ 行包含道路的描述,每行描述一条道路。\n\n道路由一对整数 $s_i, t_i$ ($1 \\leq s_i, t_i \\leq n$; $s_i \\neq t_i$) 描述 —— 这是由该道路连接的城市的编号。\n\n第 $i$ 条道路从城市 $s_i$ 指向城市 $t_i$。"}},{"title":"输出格式","value":{"format":"MD","content":"在第一行,打印出如果选择最优的罗马,需要反转的道路的最小数量 $n$。\n\n在第二行,打印出所有可能的选择罗马的方式,以递增顺序排列的城市索引序列 $1, 2, 3, ..., n$。"}},{"title":"样例 #1","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e3\n2 1\n2 3\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e0\n2 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}},{"title":"样例 #2","value":{"format":"MD","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003e输入\u003c/th\u003e\n \u003cth\u003e输出\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e4\n1 4\n2 4\n3 4\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003e2\n1 2 3 \n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e\n"}}]}