{"trustable":true,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cp\u003eWFF \u0027N PROOF是一款使用骰子玩的逻辑游戏。每个骰子有六个面,代表可能的符号K、A、N、C、E、p、q、r、s、t的一些子集。一个良构公式(WFF)是任何符号串,遵守以下规则:\u003c/p\u003e\u003cul\u003e\u003cli\u003ep、q、r、s和t是WFFs\u003c/li\u003e\u003cli\u003e如果\u003ci\u003ew\u003c/i\u003e是一个WFF,那么N\u003ci\u003ew\u003c/i\u003e也是一个WFF\u003c/li\u003e\u003cli\u003e如果\u003ci\u003ew\u003c/i\u003e和\u003ci\u003ex\u003c/i\u003e是WFFs,那么K\u003ci\u003ewx\u003c/i\u003e、A\u003ci\u003ewx\u003c/i\u003e、C\u003ci\u003ewx\u003c/i\u003e和E\u003ci\u003ewx\u003c/i\u003e也是WFFs\u003c/li\u003e\u003c/ul\u003eWFF的含义定义如下:\u003cul\u003e\u003cli\u003ep、q、r、s和t是逻辑变量,可以取值0(假)或1(真)\u003c/li\u003e\u003cli\u003eK、A、N、C、E分别表示逻辑运算符\u003ci\u003eand, or, not, implies,\u003c/i\u003e和\u003ci\u003eequals\u003c/i\u003e,如下面的真值表所定义\u003c/li\u003e\u003c/ul\u003e\u003ccenter\u003e\u003ctable cols\u003d\"1\" width\u003d\"80%\" bgcolor\u003d\"#ccffff\" border\u003d\"1\" id\u003d\"table1\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u003ccenter\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" color\u003d\"#000099\"\u003eK、A、N、C和E的定义\u003c/font\u003e\u003c/b\u003e\u003c/center\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003ctable cols\u003d\"6\" width\u003d\"80%\" bgcolor\u003d\"#ccffff\" border\u003d\"1\" id\u003d\"table2\"\u003e\u003ctbody\u003e\u003ctr\u003e\u003ctd\u003e\u0026nbsp;\u0026nbsp;\u0026nbsp;\u0026nbsp; \u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u003ci\u003ew\u003c/i\u003e\u0026nbsp; \u003ci\u003ex\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; K\u003ci\u003ewx\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; A\u003ci\u003ewx\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; N\u003ci\u003ew\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; C\u003ci\u003ewx\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; E\u003ci\u003ewx\u003c/i\u003e\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003ctr\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 0\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp;\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003ctd\u003e\u003cb\u003e\u003cfont size\u003d\"+1\" face\u003d\"Courier New,Courier\"\u003e\u0026nbsp; 1\u003c/font\u003e\u003c/b\u003e\u003c/td\u003e\u003c/tr\u003e\u003c/tbody\u003e\u003c/table\u003e\u003c/center\u003e\u003cp\u003e\u003c/p\u003e\u003cp\u003e一个\u003ci\u003e永真式\u003c/i\u003e是一个WFF,无论其变量的值如何,其值始终为1(真)。例如,\u003ci\u003eApNp\u003c/i\u003e是一个永真式,因为无论\u003ci\u003ep\u003c/i\u003e的值如何,它都为真。另一方面,\u003ci\u003eApNq\u003c/i\u003e不是永真式,因为对于\u003ci\u003ep\u003d0, q\u003d1\u003c/i\u003e,它的值为0。\u003c/p\u003e\u003cp\u003e你需要确定一个WFF是否是永真式。\u003c/p\u003e"}},{"title":"输入","value":{"format":"HTML","content":"\u003cp\u003e输入包含多个测试用例。每个测试用例是一行,包含不超过100个符号的WFF。最后一个测试用例后会跟随一行包含0的行。\u003c/p\u003e"}},{"title":"输出","value":{"format":"HTML","content":"\u003cp\u003e对于每个测试用例,输出一行,包含适当的\u003ci\u003etautology\u003c/i\u003e或\u003ci\u003enot\u003c/i\u003e。\u003c/p\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\u003eApNp\r\nApNq\r\n0\u003c/pre\u003e\u003c/td\u003e\n \u003ctd\u003e\u003cpre\u003etautology\r\nnot\u003c/pre\u003e\u003c/td\u003e\n \u003c/tr\u003e\n\u003c/tbody\u003e\n\u003c/table\u003e"}}]}