{"id":255,"date":"2006-08-05T20:09:00","date_gmt":"2006-08-05T12:09:00","guid":{"rendered":"http:\/\/114417"},"modified":"2006-08-05T20:09:00","modified_gmt":"2006-08-05T12:09:00","slug":"%e6%9c%80%e5%a4%a7%e5%8c%b9%e9%85%8d%e5%8c%88%e7%89%99%e5%88%a9%e7%ae%97%e6%b3%95","status":"publish","type":"post","link":"https:\/\/www.yewen.us\/blog\/2006\/08\/%e6%9c%80%e5%a4%a7%e5%8c%b9%e9%85%8d%e5%8c%88%e7%89%99%e5%88%a9%e7%ae%97%e6%b3%95\/","title":{"rendered":"\u6700\u5927\u5339\u914d(\u5308\u7259\u5229\u7b97\u6cd5)"},"content":{"rendered":"<pre class=\"brush: cpp; title: ; notranslate\" title=\"\">\/\/ ** Start of MaximumMatch *******************************\n\/\/ Name: MaximumMatch by Hungray O(n^3)\n\/\/ Description: mat is the adjacency matrix, nx,ny are the size of x and y,\n\/\/ fy is used for marking whether the k-th node is visited, matx&#x5B;x] means x\n\/\/ match matx&#x5B;x], maty&#x5B;y] means y match maty&#x5B;y], actually, matx&#x5B;x] is useless,\n\/\/ all the arrays start at 1\n\nint nx,ny,mat&#x5B;MAXN]&#x5B;MAXN],fy&#x5B;MAXN],matx&#x5B;MAXN],maty&#x5B;MAXN];\n\nint path(int u)\n{\n    int v;\n    for(v=1;v&amp;lt;=ny;v++)\n        if((mat&#x5B;u]&#x5B;v])&amp;amp;&amp;amp;(fy&#x5B;v]&amp;lt;0)) {\n            fy&#x5B;v]=1;\n            if((maty&#x5B;v]&amp;lt;0)||(path(maty&#x5B;v]))) {\n                matx&#x5B;u]=v;\n                maty&#x5B;v]=u;\n                return(1);\n            } \/\/ end of if((maty&#x5B;v]...\n        } \/\/ end of if((mat&#x5B;u]&#x5B;v]...\n    return(0);\n} \/\/ end of int path()\n\nint MaximumMatch()\n{\n    int i,ret=0;\n    memset(matx,-1,sizeof(matx));\n    memset(maty,-1,sizeof(maty));\n    for(i=1;i&amp;lt;=nx;i++)\n        if(matx&#x5B;i]&amp;lt;0) {\n            memset(fy,-1,sizeof(fy));\n            ret+=path(i);\n        } \/\/ end of if(matx&#x5B;i]...\n    return(ret);\n} \/\/ end of int MaximumMatch()\n\/\/ ** End of MaximumMatch *********************************<\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\/\/ ** Start of MaximumMatch *************************** [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_newsletter_access":"","_jetpack_dont_email_post_to_subs":false,"_jetpack_newsletter_tier_id":0,"_jetpack_memberships_contains_paywalled_content":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_post_was_ever_published":false},"categories":[7,11],"tags":[208,305,315,435],"class_list":["post-255","post","type-post","status-publish","format-standard","hentry","category-tech-notes","category-contests","tag-208","tag-305","tag-315","tag-435"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"jetpack_shortlink":"https:\/\/wp.me\/p4aR5e-47","_links":{"self":[{"href":"https:\/\/www.yewen.us\/blog\/wp-json\/wp\/v2\/posts\/255","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.yewen.us\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.yewen.us\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.yewen.us\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.yewen.us\/blog\/wp-json\/wp\/v2\/comments?post=255"}],"version-history":[{"count":0,"href":"https:\/\/www.yewen.us\/blog\/wp-json\/wp\/v2\/posts\/255\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.yewen.us\/blog\/wp-json\/wp\/v2\/media?parent=255"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.yewen.us\/blog\/wp-json\/wp\/v2\/categories?post=255"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.yewen.us\/blog\/wp-json\/wp\/v2\/tags?post=255"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}