{"trustable":false,"sections":[{"title":"","value":{"format":"HTML","content":"\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\u003ccenter\u003e\r\n\t\u003cp\u003e\r\n\t\t\u0026nbsp;\u003c/p\u003e\r\n\u003c/center\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 href\u003d\"\" 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 href\u003d\"\" 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 href\u003d\"\" 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 href\u003d\"\" 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\r\n\u003caddress\u003e\r\n\t\u003ci\u003eMiguel Revilla\u003c/i\u003e\u003cbr /\u003e\r\n\t\u003ci\u003e2000-08-14\u003c/i\u003e\u003c/address\u003e\r\n\u003clink href\u003d\"http://uva.onlinejudge.org/external/6/htmlatex.css\" rel\u003d\"STYLESHEET\" /\u003e"}}]}