{"id":369,"date":"2020-04-21T22:06:52","date_gmt":"2020-04-21T14:06:52","guid":{"rendered":"http:\/\/www.zyhcoding.club\/?p=369"},"modified":"2020-04-21T22:19:13","modified_gmt":"2020-04-21T14:19:13","slug":"%e6%8b%93%e6%89%91%e6%8e%92%e5%ba%8f","status":"publish","type":"post","link":"http:\/\/www.zyhcoding.club\/index.php\/2020\/04\/21\/%e6%8b%93%e6%89%91%e6%8e%92%e5%ba%8f\/","title":{"rendered":"\u62d3\u6251\u6392\u5e8f"},"content":{"rendered":"<h3>\u62d3\u6251\u6392\u5e8f<\/h3>\n<p>\u5bf9\u4e00\u4e2a\u6709\u5411\u65e0\u73af\u56fe(Directed Acyclic Graph,DAG)G\u8fdb\u884c\u62d3\u6251\u6392\u5e8f\uff0c\u662f\u5c06G\u4e2d\u7684\u7ed3\u70b9\u6392\u6210\u4e00\u4e2a\u7ebf\u6027\u5e8f\u5217\uff0c\u4f7f\u5f97\u56fe\u4e2d\u4efb\u610f\u4e00\u5bf9\u9876\u70b9u\u548cv\uff0c\u82e5\u6709\u8fb9&lt;u,v&gt;\u5c5e\u4e8eE(G)\uff0c\u5219u\u5728\u5e8f\u5217\u4e2d\u5fc5\u987b\u51fa\u73b0\u5728v\u524d\u9762\u3002\u6240\u6709\u7ed3\u70b9\u6ee1\u8db3\u8fd9\u6837\u7684\u6761\u4ef6\u5f97\u51fa\u7684\u7ebf\u6027\u5e8f\u5217\u79f0\u4e3a\u62d3\u6251\u6b21\u5e8f\u7684\u5e8f\u5217\uff0c\u7b80\u79f0\u62d3\u6251\u6392\u5e8f\u3002<br \/>\n\u9700\u8981\u7684\u53d8\u91cf\u9664\u4e86\u8fb9\u4e4b\u5916\uff0c\u8fd8\u8981\u8bbe\u7f6e\u4e00\u4e2ain[]\u6570\u7ec4\uff0cin[i]\u8868\u793a\u5f53\u524di\u7ed3\u70b9\u7684\u5165\u5ea6\u3002<br \/>\n\u677f\u5b50<\/p>\n<pre><code class=\"language-c++\">vector&lt;int&gt; edge[n];\nvoid topu(){\n    queue&lt;int&gt; q;\n    for (int i=1;i&lt;=n;i++)   if (in[i]==0)\n        q.push(i);\n    while (!q.empty()){\n        int temp = q.front();   q.pop();\n        for (int i=0;i&lt;edge[temp].size();i++){\n            in[edge[temp][i]]--;\n            if (in[edge[temp][i]]==0)\n                q.push(edge[temp][i]);\n        }\n    }\n    return;\n}<\/code><\/pre>\n<p>\u82e5\u8981\u6c42\u6309\u5b57\u5178\u5e8f\u6392\u5e8f\u65f6\uff0c\u5c06\u961f\u5217\u6362\u6210\u4f18\u5148\u961f\u5217\u5373\u53ef\u3002<br \/>\n\u62d3\u6251\u6392\u5e8f\u5728AC\u81ea\u52a8\u673a\u3001\u56de\u6587\u81ea\u52a8\u673a(PAM)\u91cc\u7684fail\u6811\u4e0a\u4f1a\u7528\u5230\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u62d3\u6251\u6392\u5e8f \u5bf9\u4e00\u4e2a\u6709\u5411\u65e0\u73af\u56fe(Directed Acyclic Graph,DAG)G\u8fdb\u884c\u62d3\u6251\u6392\u5e8f\uff0c\u662f [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[35],"tags":[],"_links":{"self":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts\/369"}],"collection":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/comments?post=369"}],"version-history":[{"count":5,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts\/369\/revisions"}],"predecessor-version":[{"id":374,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/posts\/369\/revisions\/374"}],"wp:attachment":[{"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/media?parent=369"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/categories?post=369"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.zyhcoding.club\/index.php\/wp-json\/wp\/v2\/tags?post=369"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}