{"trustable":false,"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":"MD","content":"\u003cp\u003e \n给定一个矩形区域,询问有多少个全为‘@’的连通块。\u003cbr\u003e\u003cbr\u003e\na与b属于同一连通块当且仅当至少满足下列的一个条件:\u003cbr\u003e\n1,a与b相邻。(当a在以b为中心的8个位置中的一个时,认为a与b相邻)\u003cbr\u003e\n2,a的相邻点与b或b的相邻点属于同一连通块。\u003cbr\u003e\n3,b的相邻点与a或a的相邻点属于同一连通块。\u003cbr\u003e\n\n\n\u003c/p\u003e"}},{"title":"Input","value":{"format":"MD","content":"\u003cp\u003e 输入可能有多个矩形区域(即可能有多组测试)。\u003cbr\u003e\n每个矩形区域的起始行包含m和n,表示行和列的数量,1\u0026lt;\u003dn,m\u0026lt;\u003d\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e100。\u003cbr\u003e\n当m\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e \u003d0时,输入结束。\u003cbr\u003e\n接下来是n行,每行m个字符。\u003cbr\u003e\n每个字符对应一个小方格,要么是\u0027*\u0027\u003cspan\u003e\u003cspan\u003e\u003cspan\u003e,代表禁止区域,要么是\u0027@\u0027。\u003c/span\u003e\u003c/span\u003e\u003c/span\u003e\u003c/p\u003e"}},{"title":"Output","value":{"format":"MD","content":"\u003cp\u003e 对于每一个矩形区域,输出\u0027@\u0027的连通块数量。\u003c/p\u003e"}},{"title":"text Input","value":{"format":"MD","content":"\u003cdiv\u003e \n \u003cdiv\u003e\n \u0026nbsp;\n \u003c/div\u003e \n \u003cdiv\u003e \n \u003cdiv\u003e\n 1 1\n \u003c/div\u003e \n \u003c/div\u003e \n \u003cdiv\u003e\n *\n \u003c/div\u003e \n \u003cdiv\u003e\n 3 5\n \u003c/div\u003e \n \u003cdiv\u003e\n *@*@*\n \u003c/div\u003e \n \u003cdiv\u003e\n **@**\n \u003c/div\u003e \n \u003cdiv\u003e\n *@*@*\n \u003c/div\u003e \n \u003cdiv\u003e\n 1 8\n \u003c/div\u003e \n \u003cdiv\u003e\n @@****@*\n \u003c/div\u003e \n \u003cdiv\u003e\n 5 5\u0026nbsp;\n \u003c/div\u003e \n \u003cdiv\u003e\n ****@\n \u003c/div\u003e \n \u003cdiv\u003e\n *@@*@\n \u003c/div\u003e \n \u003cdiv\u003e\n *@**@\n \u003c/div\u003e \n \u003cdiv\u003e\n @@@*@\n \u003c/div\u003e \n \u003cdiv\u003e\n @@**@\n \u003c/div\u003e \n \u003cdiv\u003e\n 0 0\u0026nbsp;\n \u003c/div\u003e \n \u003cdiv\u003e\n \u0026nbsp;\n \u003c/div\u003e \n\u003c/div\u003e"}},{"title":"text Output","value":{"format":"MD","content":"\u003cpre\u003e\n\u003c/pre\u003e \n\u003cdiv\u003e \n \u003cdiv\u003e\n 0\n \u003c/div\u003e \n\u003c/div\u003e \n\u003cdiv\u003e\n 1\n\u003c/div\u003e \n\u003cdiv\u003e\n 2\n\u003c/div\u003e \n\u003cdiv\u003e\n 2\n\u003c/div\u003e"}}]}