{"id":45532,"date":"2023-12-11T15:06:06","date_gmt":"2023-12-11T07:06:06","guid":{"rendered":"https:\/\/wx.kaifamiao.info\/?p=45532"},"modified":"2023-12-11T15:06:06","modified_gmt":"2023-12-11T07:06:06","slug":"%e6%89%8b%e6%92%95%e4%bb%a3%e7%a0%81%ef%bc%9a0-1%e7%9f%a9%e9%98%b5%e7%9a%84%e6%9c%80%e5%a4%a7%e6%ad%a3%e6%96%b9%e5%bd%a2-2","status":"publish","type":"post","link":"http:\/\/wx.kaifamiao.info\/index.php\/2023\/12\/11\/%e6%89%8b%e6%92%95%e4%bb%a3%e7%a0%81%ef%bc%9a0-1%e7%9f%a9%e9%98%b5%e7%9a%84%e6%9c%80%e5%a4%a7%e6%ad%a3%e6%96%b9%e5%bd%a2-2\/","title":{"rendered":"\u624b\u6495\u4ee3\u7801\uff1a0-1\u77e9\u9635\u7684\u6700\u5927\u6b63\u65b9\u5f62"},"content":{"rendered":"<p>&#8220;`&#8221;<\/p>\n<p>\u53c2\u8003\u56de\u7b54\uff1a<\/p>\n<p>&lt;pre&gt;&lt;code&gt;public int maxSquare(int matrix) {<br \/>\n    int row = matrix.length;  \/\/\u884c\u5927\u5c0f<br \/>\n    int line = matrix[0].length;  \/\/\u5217\u5927\u5c0f<br \/>\n    \/\/\u4e00\u4e2a\u4e0ematrix\u76f8\u540c\u5927\u5c0f\u7684\u8f85\u52a9\u6570\u7ec4<br \/>\n    int tmp = new introw;<br \/>\n    \/\/\u5c06matrix\u7684\u7b2c\u4e00\u884c\u548c\u7b2c\u4e00\u5217\u5143\u7d20\u76f4\u63a5\u5b58\u653e\u5230<\/p>\n<p>    for(int i=0;i&lt;row;i++){<br \/>\n    tmp[i][0] = matrix[i][0];<br \/>\n    }<br \/>\n    for(int i=0;i&lt;line;i++){<br \/>\n    tmp[0][i] = matrix[0][i];<br \/>\n    }<br \/>\n    for(int i=1;i&lt;row;i++){<br \/>\n    for(int j=1;j&lt;line;j++){<br \/>\n    if(matrix[i][j] == 1){<br \/>\n    tmp[i][j] =<br \/>\n    Math.min(Math.min(tmp[i-1][j],tmp[i][j-1]),tmp[i-1][j-1]) + 1;<br \/>\n    }<br \/>\n    if(matrix[i][j] == 0){<br \/>\n    tmp[i][j] = 0;<br \/>\n    }<br \/>\n    }<br \/>\n    }<br \/>\n    int max=0;  \/\/\u8bb0\u5f55tmp\u4e2d\u6700\u5927\u5143\u7d20\u7684\u503c\uff08tmp\u4e2d\u5143\u7d20\u503c\u8868\u793a\u6b63\u65b9\u5f62\u7684\u8fb9\u957f)<br \/>\n    for(int i=0;i&lt;row;i++){<br \/>\n        for(int j=0;j&lt;line;j++){<br \/>\n           if(tmp[i][j] &gt; max){<br \/>\n                max = tmp[i][j];<br \/>\n           }<br \/>\n         }<br \/>\n   }<br \/>\n   return max*max;<br \/>\n}<\/p>\n<p>&lt;\/code&gt;&lt;\/pre&gt;<\/p>\n<p>&lt;pre&gt;&lt;code&gt;            &quot;&#8220;`<br \/>\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>&#8220;`&#8221; \u53c2\u8003\u56de\u7b54\uff1a &lt;pre&gt;&lt;code&gt;public int [&hellip;]<\/p>\n","protected":false},"author":7,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[101],"tags":[],"class_list":["post-45532","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/45532","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/users\/7"}],"replies":[{"embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/comments?post=45532"}],"version-history":[{"count":1,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/45532\/revisions"}],"predecessor-version":[{"id":45533,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/posts\/45532\/revisions\/45533"}],"wp:attachment":[{"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/media?parent=45532"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/categories?post=45532"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/wx.kaifamiao.info\/index.php\/wp-json\/wp\/v2\/tags?post=45532"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}