{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cstyle type\u003d\"text/css\"\u003e .sampledata { font-family: \"Courier New\", Courier, monospace; white-space: pre; }\u003c/style\u003e\u003cp\u003e 自从明明学了树的结构,就对奇怪的树产生了兴趣......给出标号为1到N的点,以及某些点最终的度数,允许在\u003cbr\u003e 任意两点间连线,可产生多少棵度数满足要求的树?\u003c/p\u003e"}},{"title":"Input","value":{"format":"HTML","content":"\u003cp\u003e 第一行为N(0 \u0026lt; N \u0026lt; \u003d 1000),\u003cbr\u003e 接下来N行,第i+1行给出第i个节点的度数Di,如果对度数不要求,则输入-1\u003c/p\u003e"}},{"title":"Output","value":{"format":"HTML","content":"\u003cp\u003e 一个整数,表示不同的满足要求的树的个数,无解输出0\u003c/p\u003e"}},{"title":"Sample Input","value":{"format":"HTML","content":"\u003cspan class\u003dsampledata\u003e3\r\n1\r\n-1\r\n-1\u003c/span\u003e\u003c/div\u003e"}},{"title":"Sample Output","value":{"format":"HTML","content":"\u003cspan class\u003dsampledata\u003e2\u003c/span\u003e\u003c/div\u003e"}},{"title":"Hint","value":{"format":"HTML","content":"\u003cp\u003e\u003c/p\u003e\n\u003cp\u003e 两棵树分别为1-2-3;1-3-2\u003c/p\u003e\n\u003cp\u003e\u003c/p\u003e"}}]}