{"id":143,"date":"2011-08-21T23:43:21","date_gmt":"2011-08-21T15:43:21","guid":{"rendered":"http:\/\/wangkaixuan.tech\/?p=143"},"modified":"2020-06-03T23:43:59","modified_gmt":"2020-06-03T15:43:59","slug":"poj-2051-argus","status":"publish","type":"post","link":"http:\/\/www.wangkaixuan.tech\/?p=143","title":{"rendered":"poj 2051 Argus"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>\/*\n\u6a21\u62df\u9898 \n*\/\n#define LOCAL\n#include&lt;iostream>\n#include&lt;cstdio>\n#include&lt;cmath>\n#include&lt;cstring>\n#include&lt;cstdlib>\n#include&lt;iomanip>\n#include&lt;string>\n#include&lt;algorithm>\n#include&lt;ctime>\n#include&lt;stack>\n#include&lt;queue>\n#include&lt;vector>\n#define N 1005\nusing namespace std;\nclass Node\n{public:long long qnum,period,record;};\nbool cmp(const Node &amp;p,const Node &amp;q)\/\/\u4e8c\u7ea7\u6392\u5e8f \n{\n       if(p.qnum&lt;q.qnum)\n       return true;\n       else return false;     \n}\nint main()\n{\n#ifdef LOCAL\n       freopen(\"input.txt\",\"r\",stdin);\n       freopen(\"output.txt\",\"w\",stdout);\n#endif\n \n        string temp;int len=0,k,min,i;Node node&#91;N];\n        while(cin>>temp&amp;&amp;temp!=\"#\")\n        {\n                   cin>>node&#91;len].qnum>>node&#91;len].period;\n                   node&#91;len].record=node&#91;len].period;len++;\n        }\n        sort(node,node+len,cmp);\n        cin>>k;\n        while(1)\n        {\n               min=node&#91;0].period;\n               for(i=1;i&lt;len;i++)\n               {\n                     if(min>node&#91;i].period)\n                     {\n                              min=node&#91;i].period;                       \n                     }                  \n               }\n               for(i=0;i&lt;len;i++)\n               {\n                        if(node&#91;i].period==min)\n                        {\n                                  cout&lt;&lt;node&#91;i].qnum&lt;&lt;endl;\n                                  node&#91;i].period+=node&#91;i].record;  \n                                  k--;\n                                  if(k==0) return 0;                     \n                        }                  \n               }\n        }\n        return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[7],"tags":[],"class_list":["post-143","post","type-post","status-publish","format-standard","hentry","category-06-01-acm"],"_links":{"self":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/143","targetHints":{"allow":["GET"]}}],"collection":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=143"}],"version-history":[{"count":0,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=\/wp\/v2\/posts\/143\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=143"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=143"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.wangkaixuan.tech\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=143"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}