{"trustable":true,"prependHtml":"\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 async src\u003d\"https://mathjax.codeforces.org/MathJax.js?config\u003dTeX-AMS-MML_HTMLorMML\" type\u003d\"text/javascript\"\u003e\u003c/script\u003e","sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv class\u003d\"panel_content\"\u003e最近发现了如何在Y-Crate游戏设备上运行开源软件。许多有进取心的设计师已经为Y-Crate开发了类似冒险风格的游戏。你的任务是测试其中一些设计,看看哪些是可以赢得的。\u003cbr\u003e每个游戏由最多100个房间组成。其中一个房间是起点,另一个房间是终点。每个房间的能量值在-100到+100之间。单向门连接了房间对。\u003cbr\u003e\u003cbr\u003e玩家从起点房间开始,拥有100点能量。她可以通过连接她所在房间的任何门口,进入另一个房间。该房间的能量值将被添加到玩家的能量中。这个过程将继续,直到她通过进入终点房间获胜,或者由于能量耗尽而死亡(或因沮丧而退出)。在冒险过程中,玩家可能多次进入同一个房间,每次都会获得该房间的能量。\u003cbr\u003e\u003c/div\u003e"}},{"title":"输入","value":{"format":"HTML","content":"输入包含多个测试用例。每个测试用例以n开头,表示房间的数量。房间从1(起点房间)到n(终点房间)编号。接下来是每个房间的输入。每个房间的输入包括一个或多个包含:\u003cbr\u003e\u003cbr\u003e第i个房间的能量值\u003cbr\u003e离开第i个房间的门数量\u003cbr\u003e可通过离开第i个房间的门到达的房间列表\u003cbr\u003e起点和终点房间的能量级别始终为0。最后一个测试用例后面跟着一行包含-1。\u003cbr\u003e"}},{"title":"输出","value":{"format":"HTML","content":"对于每个测试用例,输出一行,如果玩家可以获胜,则输出“winnable”,否则输出“hopeless”。\u003cbr\u003e"}},{"title":"示例","value":{"format":"HTML","content":"\u003ctable class\u003d\u0027vjudge_sample\u0027\u003e\n\u003cthead\u003e\n \u003ctr\u003e\n \u003cth\u003eInput\u003c/th\u003e\n \u003cth\u003eOutput\u003c/th\u003e\n \u003c/tr\u003e\n\u003c/thead\u003e\n\u003ctbody\u003e\n \u003ctr\u003e\n \u003ctd\u003e\u003cpre\u003e5\r\n0 1 2\r\n-60 1 3\r\n-60 1 4\r\n20 1 5\r\n0 0\r\n5\r\n0 1 2\r\n20 1 3\r\n-60 1 4\r\n-60 1 5\r\n0 0\r\n5\r\n0 1 2\r\n21 1 3\r\n-60 1 4\r\n-60 1 5\r\n0 0\r\n5\r\n0 1 2\r\n20 2 1 3\r\n-60 1 4\r\n-60 1 5\r\n0 0\r\n-1\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003ehopeless\r\nhopeless\r\nwinnable\r\nwinnable\r\n\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}