{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\u003cdiv id\u003d\"yass_top_edge_dummy\" style\u003d\"width: 1px; height: 1px; padding: 0px; margin: -9px 0px 0px; border-width: 0px; display: block;\"\u003e\r\n\t\u0026nbsp;\u003c/div\u003e\r\n\u003cdiv id\u003d\"yass_top_edge\" style\u003d\"background-image: url(\u0026quot;chrome://yass/content/edgebgtop.png\u0026quot;); background-attachment: scroll; background-position: center bottom; padding: 0px; margin: 0px 0px 8px -8px; border-width: 0px; height: 0px; display: block; width: 1px;\"\u003e\r\n\t\u0026nbsp;\u003c/div\u003e\r\n\u003cstyle type\u003d\"text/css\"\u003e\r\nh1,h2,h3,h4,h5,h6{margin-bottom:0;}div.textBG p{margin: 0 0 0.0001pt;}\u003c/style\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\tYou are given a string consisting of parentheses \u003ctt\u003e()\u003c/tt\u003e and \u003ctt\u003e[]\u003c/tt\u003e. A string of this type is said to be \u003cem\u003ecorrect\u003c/em\u003e:\u003c/p\u003e\r\n\u003cdl compact\u003d\"compact\"\u003e\r\n\t\u003cdt\u003e\r\n\t\t(a)\u003c/dt\u003e\r\n\t\u003cdd\u003e\r\n\t\tif it is the empty string\u003c/dd\u003e\r\n\t\u003cdt\u003e\r\n\t\t(b)\u003c/dt\u003e\r\n\t\u003cdd\u003e\r\n\t\tif A and B are correct, AB is correct,\u003c/dd\u003e\r\n\t\u003cdt\u003e\r\n\t\t(c)\u003c/dt\u003e\r\n\t\u003cdd\u003e\r\n\t\tif A is correct, \u003ctt\u003e(\u003c/tt\u003eA\u003ctt\u003e)\u003c/tt\u003e and \u003ctt\u003e[\u003c/tt\u003eA\u003ctt\u003e]\u003c/tt\u003e is correct.\u003c/dd\u003e\r\n\u003c/dl\u003e\r\n\u003cp\u003e\r\n\tWrite a program that takes a sequence of strings of this type and check their correctness. Your program can assume that the maximum string length is 128.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001001000000000000000\"\u003e Input\u003c/a\u003e\u0026nbsp;\u003c/font\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\tThe file contains a positive integer \u003ci\u003en\u003c/i\u003e and a sequence of \u003ci\u003en\u003c/i\u003e strings of parentheses \u003ctt\u003e()\u003c/tt\u003e and \u003ctt\u003e[]\u003c/tt\u003e, one string a line.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001002000000000000000\"\u003e Output\u003c/a\u003e\u0026nbsp;\u003c/font\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\tA sequence of \u003ctt\u003eYes\u003c/tt\u003e or \u003ctt\u003eNo\u003c/tt\u003e on the output file.\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001003000000000000000\"\u003e Sample Input\u003c/a\u003e\u0026nbsp;\u003c/font\u003e\u003c/h2\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cpre\u003e\r\n3\r\n([])\r\n(([()])))\r\n([()[]()])()\r\n\u003c/pre\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003ch2\u003e\r\n\t\u003cfont color\u003d\"#0070E8\"\u003e\u003ca name\u003d\"SECTION0001004000000000000000\"\u003e Sample Output\u003c/a\u003e\u0026nbsp;\u003c/font\u003e\u003c/h2\u003e\r\n\u003cpre\u003e\r\nYes\r\nNo\r\nYes\r\n\u003c/pre\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003cp\u003e\r\n\t\u0026nbsp;\u003c/p\u003e\r\n\u003chr /\u003e"}}]}