{"id":705,"date":"2023-10-18T22:12:10","date_gmt":"2023-10-18T14:12:10","guid":{"rendered":"http:\/\/ggapa.net:81\/?p=705"},"modified":"2023-10-18T22:12:10","modified_gmt":"2023-10-18T14:12:10","slug":"%e6%97%a0%e5%90%91%e5%9b%be%e7%9a%84%e8%bf%9e%e9%80%9a%e6%80%a7","status":"publish","type":"post","link":"http:\/\/ggapa.net:81\/2023\/10\/18\/%e6%97%a0%e5%90%91%e5%9b%be%e7%9a%84%e8%bf%9e%e9%80%9a%e6%80%a7\/","title":{"rendered":"\u65e0\u5411\u56fe\u7684\u8fde\u901a\u6027"},"content":{"rendered":"

\u5272\u70b9<\/h1>\n

\u4ec0\u4e48\u662f\u5272\u70b9<\/h2>\n

\u5728\u65e0\u5411\u56fe\u4e2d\u6240\u6709\u80fd\u591f\u4e92\u901a\u7684\u70b9\u6784\u6210\u4e86\u8fde\u901a\u5206\u91cf\uff0c\u5176\u4e2d\u6709\u4e00\u4e9b\u5173\u952e\u7684\u70b9\uff0c\u5982\u679c\u5220\u9664\u5b83\uff0c\u5982\u679c\u8fd9\u4e2a\u8054\u901a\u5206\u91cf\u88ab\u5206\u6210\u4e86\u4e24\u4e2a\u6216\u8005\u66f4\u591a\uff0c\u5219\u79f0\u8fd9\u4e2a\u70b9\u4e3a\u5272\u70b9\u3002<\/p>\n

\u901a\u4fd7\u7684\u8bb2\uff0c\u73b0\u5728\u6709\u5f88\u591a\u4e2a\u4e3b\u673a\u8fde\u5728\u4e00\u8d77\u6784\u6210\u7f51\u7edc\uff0c\u4f46\u662f\u5982\u679c\u6709\u4e00\u4e2a\u4e3b\u673a\u70c2\u6389\u4e86,\u4f60\u5c31\u65e0\u6cd5\u8bbf\u95ee\u6d1b\u8c37\uff0c\u5219\u79f0\u5219\u79f0\u8fd9\u4e2a\u4e3b\u673a\u662f\u4e00\u4e2a\u5272\u70b9\u3002<\/p>\n

\u6c42\u5272\u70b9<\/h2>\n

\u5728\u901a\u8fc7 DFS \u904d\u5386\u4e2a\u56fe\u7684\u65f6\u5019\uff0c\u5f88\u5bb9\u6613\u53d1\u73b0\u5982\u679c\u4e00\u4e2a\u70b9\u662f\u5272\u70b9\uff0c\u5219\u5b83\u7684\u513f\u5b50\u4eec\u90fd\u65e0\u6cd5\u4e0d\u901a\u8fc7\u8fd8\u6ca1\u88ab\u8bbf\u95ee\u8fc7\u7684\u8fb9\u8fd4\u56de\u5272\u70b9\u4e4b\u524d\u7684\u70b9\uff0c\u5982\u4e0b\u56fe\u6240\u793a\uff1a<\/p>\n

\"piPsZhd.png\"<\/div><\/p>\n

\u53ef\u4ee5\u53d1\u73b0\u8282\u70b9 2\u30013 \u90fd\u662f\u5272\u70b9\uff0c\u8282\u70b9 2 \u7684\u5b50\u8282\u70b9\u4eec\u4e0d\u80fd\u5728\u4e0d\u901a\u8fc7\u8282\u70b9 2 \u7684\u60c5\u51b5\u4e0b\u5230\u8fbe\u8282\u70b9\u4e00\uff0c\u8282\u70b9 3 \u7684\u5b50\u8282\u70b9\u4eec\u53ea\u80fd\u901a\u8fc7 3 \u5230\u8fbe\u8282\u70b9 1\u30012\u3002<\/p>\n

\u4f46\u662f\u8282\u70b9 4 \u4e0d\u662f\u5272\u70b9\uff0c\u56e0\u4e3a\u8282\u70b9 5 \u53ef\u4ee5\u76f4\u63a5\u8df3\u8fc7\u8282\u70b9 4 \u5230\u8fbe\u8282\u70b9 3\u3002<\/p>\n

\u77e5\u9053\u4e86\u6c42\u5272\u70b9\u7684\u539f\u7406\u4e4b\u540e\u6211\u4eec\u8003\u8651\u7b97\u6cd5\u5b9e\u73b0\uff0c\u5b9a\u4e49\u4e24\u4e2a\u6570\u7ec4 $dfn[i]$ \u548c $low[i]$\u3002 <\/p>\n

$dfn[i]$ \u8868\u793a\u7b2c $i$ \u4e2a\u8282\u70b9\u7b2c\u4e00\u6b21\u88ab\u8bbf\u95ee\u5230\u7684\u987a\u5e8f\u3002<\/p>\n

$low[i]$ \u8868\u793a\u7b2c $i$ \u4e2a\u8282\u70b9\u548c $i$ \u7684\u540e\u4ee3\u5728\u4e0d\u7ecf\u8fc7\u5df2\u7ecf\u88ab\u8bbf\u95ee\u8fc7\u7684\u8fb9\u7684\u6761\u4ef6\u4e0b\uff0c\u80fd\u5230\u8fbe\u7684 $dfn[]$ \u6700\u5c0f\u7684\u8282\u70b9\u3002<\/p>\n

\u5c06\u521a\u521a\u7684\u56fe\u4ece\u8282\u70b9 1 \u5f00\u59cb\u904d\u5386\u5f97\u5230\u7684\u7ed3\u679c\u5982\u4e0b\uff1a<\/p>\n

\"piPsGNQ.png\"<\/div><\/a><\/p>\n

\u8282\u70b9 4\u30015 \u90fd\u80fd\u901a\u8fc7\u4e00\u6761\u53e6\u5916\u7684\u8fb9\u8fd4\u56de\u8282\u70b9 3\u3002<\/p>\n

\u6545\u6211\u4eec\u5c31\u6709\u4e86\u4ee5\u4e0b\u7684\u4ee3\u7801\uff1a<\/p>\n

vector<int> G[maxn];\nint dfn[maxn], low[maxn];\nbool iscut[maxn];\nint cutsum = 0;\nint root;\n\nvoid dfs(int x) {\n    dfn[x] = low[x] = dfn[0]++;\n    int son = 0;\n    for(auto to : G[x]) {\n        if(!dfn[to]) {\n            son++;\n            dfs(to);\n            low[x] = min(low[x], low[to]);                      \/\/\u5982\u679c\u4ed6\u7684\u540e\u4ee3\u80fd\u5230\u8fbe\uff0c\u90a3\u5b83\u4e5f\u53ef\u4ee5 \n            if(low[to] >= dfn[x] && x != root) cutsum += !iscut[x], iscut[x] = true; \/\u8fd9\u6837\u5b50\u5199\u53ef\u4ee5\u65b9\u4fbf\u53bb\u91cd \n        }\n        else    \/\/\u5982\u679c\u8fb9\u5df2\u7ecf\u88ab\u8bbf\u95ee\u8fc7\u4e86\uff0c\u56de\u9000\u5904\u7406                                               \n            low[x] = min(low[x], dfn[to]);\n    }\n    if(son >= 2 && x == root) cutsum += !iscut[x], iscut[x] = true;\n}\n<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"

\u5272\u70b9 \u4ec0\u4e48\u662f\u5272\u70b9 \u5728\u65e0\u5411\u56fe\u4e2d\u6240\u6709\u80fd\u591f\u4e92\u901a\u7684\u70b9\u6784\u6210\u4e86\u8fde\u901a\u5206\u91cf\uff0c\u5176\u4e2d\u6709\u4e00\u4e9b\u5173\u952e\u7684\u70b9\uff0c\u5982\u679c\u5220\u9664\u5b83\uff0c\u5982\u679c\u8fd9\u4e2a\u8054\u901a\u5206\u91cf\u88ab […]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[12],"tags":[25],"_links":{"self":[{"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/posts\/705"}],"collection":[{"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/comments?post=705"}],"version-history":[{"count":1,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/posts\/705\/revisions"}],"predecessor-version":[{"id":706,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/posts\/705\/revisions\/706"}],"wp:attachment":[{"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/media?parent=705"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/categories?post=705"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/ggapa.net:81\/wp-json\/wp\/v2\/tags?post=705"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}