{"trustable":false,"prependHtml":"\u003cstyle type\u003d\"text/css\"\u003e\n section pre {\n display: block;\n padding: 9.5px;\n margin: 0 0 10px;\n font-size: 13px;\n line-height: 1.42857143;\n word-break: break-all;\n word-wrap: break-word;\n color: #333;\n background: rgba(255, 255, 255, 0.5);\n border: 1px solid #ccc;\n border-radius: 6px;\n }\n\u003c/style\u003e\n\u003cscript\u003e\n window.katexOptions \u003d {\n delimiters: [\n {left: \u0027\\\\(\u0027, right: \u0027\\\\)\u0027, display: false},\n {left: \u0027\\\\[\u0027, right: \u0027\\\\]\u0027, display: true}\n ]\n };\n\u003c/script\u003e\n","sections":[{"title":"Problem Statement","value":{"format":"PLAIN","content":"Có N công tắc và M đèn.\nĐèn thứ i được kết nối với k_i công tắc: công tắc s_i_1 s_i_2 ... s_i_k_i.\nĐèn sẽ bật nếu số công tắc nối với nó mà bật đồng dư p_i mod 2.\n\nHãy tính xem có bao nhiêu cách để bật tắt các công tắc sao cho toàn bộ đèn sáng."}},{"title":"Constraints","value":{"format":"PLAIN","content":"1 \u003c\u003d N, M \u003c\u003d 10\n1 \u003c\u003d k_i \u003c\u003d N\n1 \u003c\u003d s_i_j \u003c\u003d N\n0 \u003c\u003d p_i \u003c\u003d 1"}},{"title":"Input","value":{"format":"PLAIN","content":"N M\nk_1 s_1_1 ...s_1_k_1\n...\nk_M s_M_1 ... s_M_k_M\np_1 p_2 ... p_M"}},{"title":"Output","value":{"format":"PLAIN","content":"In ra số cách"}},{"title":"Sample Input 1","value":{"format":"PLAIN","content":"2 2\n2 1 2\n1 2\n0 1\n"}},{"title":"Sample Output 1","value":{"format":"PLAIN","content":"1"}},{"title":"Sample Input 2","value":{"format":"PLAIN","content":"2 3\n2 1 2\n1 1\n1 2\n0 0 1\n"}},{"title":"Sample Output 2","value":{"format":"PLAIN","content":"0"}},{"title":"Sample Input 3","value":{"format":"PLAIN","content":"5 2\n3 1 2 5\n2 2 3\n1 0\n"}},{"title":"Sample Output 3","value":{"format":"PLAIN","content":"8\n"}}]}