{"id":36,"date":"2023-01-30T22:04:00","date_gmt":"2023-01-30T14:04:00","guid":{"rendered":"https:\/\/solost.cn\/?p=36"},"modified":"2023-02-02T00:49:34","modified_gmt":"2023-02-01T16:49:34","slug":"72","status":"publish","type":"post","link":"https:\/\/solost.cn\/?p=36","title":{"rendered":"2023\u725b\u5ba2\u5bd2\u5047\u7b97\u6cd5\u57fa\u7840\u96c6\u8bad\u84254-\u6e05\u695a\u59d0\u59d0\u6253\u602a\u5347\u7ea7"},"content":{"rendered":"<p><img decoding=\"async\" src=\"\/wp-content\/uploads\/2026\/11\/2772997031.png\" alt=\"2772997031.png\" title=\"2772997031.png\"><\/p>\n<h2>solution<\/h2>\n<p>\u6ce8\u610f\uff0c\u602a\u7269\u6bcf\u79d2\u90fd\u56de\u8840\uff0c\u4f46\u662f\u653b\u51fb\u662f\u6bcft\u79d2\u624d\u4f1a\u653b\u51fb\u4e00\u6b21\uff0c\u5982\u679c\u8840\u91cf\u4e00\u6b21\u79d2\u4e0d\u6389\u7684\u8bdd\uff0c\u6bcf\u56de\u5408\u7684\u653b\u51fb\u4f24\u5bb3\u5c0f\u4e8e\u7b49\u4e8e\u56de\u8840\u91cf<code>vt<\/code>\u90a3\u4e48\u5c06\u6c38\u8fdc\u6740\u4e0d\u6389\uff0c\u8f93\u51fa-1\uff1b<\/p>\n<p>\u6c42\u5728\u7b2c\u51e0\u56de\u5408k\u80fd\u6740\u4e86\u4ed6\uff0c\u6bcf\u6b21\u5148\u780d\u4e00\u5200\uff0c\u5982\u679c\u4e00\u5200\u780d\u4e0d\u6b7b\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u76f4\u63a5\u5f00\u59cb\u7b97\u4e86\uff0c\u90a3\u4e48\u5c31\u662f<code>h - a + kvt &lt;= ka<\/code>\uff0c\u5316\u7b80\u540e\u5c31\u662f<code>k &gt;= (h - v) \/ (a - vt)<\/code>\u5411\u4e0a\u53d6\u6574\uff0c\u56e0\u4e3a\u6bcf\u4e2a\u4eba\u90fd\u81f3\u5c11\u780d\u4e00\u5200,\u53c8\u56e0\u4e3a\u80fd\u591a\u780d\u51e0\u5200\u7684\u4eba\uff0c\u6240\u4ee5\u5728\u52a0\u4e0ak\uff0c\u7136\u540e\u7b97\u51fa\u6765\u4e86\u591a\u5c11\u56de\u5408\uff0c\u518d\u7b97\u79d2\u6570\uff0c\u8003\u8651\u5982\u679c\u4e0d\u80fd\u4e00\u5200\u79d2\u6740\uff0c\u90a3\u4e48\u602a\u7269\u5fc5\u5b9a\u4f1a\u7ecf\u8fc7\u81f3\u5c11\u4e00\u6b21\u6389\u8840+\u56de\u8840\u7684\u5faa\u73af\u3002\u800c\u6700\u540e\u4e00\u6b21\u51fb\u6740\u540e\uff0c\u602a\u7269\u7acb\u523b\u6b7b\u4ea1\u80af\u5b9a\u4e0d\u4f1a\u56de\u8840\u3002\u6bcf\u4e2a\u602a\u7269\u5c31\u9700\u8981k + 1\u6b21\uff0c\u6700\u540e\u7684\u7ed3\u679c\u5c31\u662f<code>(ans - 1) * t + 1<\/code>,\u56e0\u4e3a\u6700\u540e\u4e00\u56de\u5408\u6700\u540e\u4e00\u5200\u780d\u6b7b\uff0c\u7136\u540e\u53ea\u4f1a\u591a\u4e00\u79d2\uff0c\u4e0d\u4f1a\u591a\u4e00\u573a\u7684\u65f6\u95f4\u3002<\/p>\n<pre><code class=\"lang-cpp\">#include&lt;map&gt;\n#include&lt;set&gt;\n#include&lt;stack&gt;\n#include&lt;queue&gt;\n#include&lt;cmath&gt;\n#include&lt;vector&gt;\n#include&lt;bitset&gt;\n#include&lt;cstdio&gt;\n#include&lt;cstring&gt;\n#include&lt;fstream&gt;\n#include&lt;cstdlib&gt;\n#include&lt;iostream&gt;\n#include&lt;algorithm&gt;\n#include&lt;unordered_map&gt;\n\nusing namespace std;\n#define endl &#039;\\n&#039;\n#define IOS                       \\\n    ios_base::sync_with_stdio(0); \\\n    cin.tie(0);                   \\\n    cout.tie(0);\ntypedef long long ll;\ntypedef pair&lt;int,int&gt; PII;\ntypedef unsigned long long ull;\nconst int INF = 0x3f3f3f3f, mod = 1000000007;\nconst int N = 2e5 + 10;\n\nint main(){\n    int n, t, a, f = 1;\n    cin &gt;&gt; n &gt;&gt; t &gt;&gt; a;\n    ll ans = n;\n    for(int i = 1; i &lt;= n; i++){\n        int h, v;\n        cin &gt;&gt; h &gt;&gt; v;\n        if(h &gt; a &amp;&amp; v * t &gt;= a)\n            f = 0;\n        if(h &gt; a &amp;&amp; f)\n            ans += (h - a + (a - v * t - 1)) \/ (a - v * t);\n    }\n    if(f){\n        cout &lt;&lt; (ans - 1) * t + 1 &lt;&lt; endl;\n    }\n    else{\n        cout &lt;&lt; &quot;-1\\n&quot;;\n    }\n    return 0;\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>solution \u6ce8\u610f\uff0c\u602a\u7269\u6bcf\u79d2\u90fd\u56de\u8840\uff0c\u4f46\u662f\u653b\u51fb\u662f\u6bcft\u79d2\u624d\u4f1a\u653b\u51fb\u4e00\u6b21\uff0c\u5982\u679c\u8840\u91cf\u4e00\u6b21\u79d2\u4e0d\u6389\u7684\u8bdd\uff0c\u6bcf\u56de\u5408\u7684\u653b\u51fb\u4f24\u5bb3\u5c0f\u4e8e\u7b49\u4e8e\u56de\u8840\u91cfvt\u90a3\u4e48\u5c06\u6c38\u8fdc\u6740\u4e0d\u6389\uff0c\u8f93\u51fa-1\uff1b \u6c42\u5728\u7b2c\u51e0\u56de\u5408k\u80fd\u6740\u4e86\u4ed6\uff0c\u6bcf\u6b21\u5148\u780d\u4e00\u5200\uff0c\u5982\u679c\u4e00\u5200\u780d\u4e0d\u6b7b\uff0c\u90a3\u4e48\u5c31\u53ef\u4ee5\u76f4\u63a5\u5f00\u59cb\u7b97\u4e86\uff0c\u90a3\u4e48\u5c31\u662fh - a + kvt &lt;= ka\uff0c\u5316\u7b80\u540e\u5c31\u662fk &gt;= (h - v) \/ (a - vt)\u5411\u4e0a\u53d6\u6574\uff0c\u56e0\u4e3a\u6bcf\u4e2a\u4eba\u90fd\u81f3\u5c11\u780d\u4e00\u5200,\u53c8\u56e0\u4e3a\u80fd\u591a\u780d\u51e0\u5200\u7684\u4eba\uff0c\u6240\u4ee5\u5728\u52a0\u4e0ak\uff0c\u7136\u540e\u7b97\u51fa\u6765\u4e86\u591a\u5c11\u56de\u5408\uff0c\u518d\u7b97\u79d2\u6570\uff0c\u8003\u8651\u5982\u679c\u4e0d\u80fd\u4e00\u5200\u79d2\u6740\uff0c\u90a3\u4e48\u602a\u7269\u5fc5\u5b9a\u4f1a\u7ecf\u8fc7\u81f3\u5c11\u4e00\u6b21\u6389\u8840+\u56de\u8840\u7684\u5faa\u73af\u3002\u800c\u6700\u540e\u4e00\u6b21\u51fb\u6740\u540e\uff0c\u602a\u7269\u7acb\u523b\u6b7b\u4ea1\u80af\u5b9a\u4e0d\u4f1a\u56de\u8840\u3002\u6bcf\u4e2a\u602a\u7269\u5c31\u9700\u8981k + 1\u6b21\uff0c\u6700\u540e\u7684\u7ed3\u679c\u5c31\u662f(ans - 1) * t + 1,\u56e0\u4e3a\u6700\u540e\u4e00\u56de\u5408\u6700\u540e\u4e00\u5200\u780d\u6b7b\uff0c\u7136\u540e\u53ea\u4f1a\u591a\u4e00\u79d2\uff0c\u4e0d\u4f1a\u591a\u4e00\u573a\u7684\u65f6\u95f4\u3002 #include&lt;map&gt; #include&lt;set&gt; #include&lt;stack&gt; #include&lt;queue&gt; #include&lt;cmath&gt; #include&lt;vector&gt; #include&lt;bitset&gt; #include&lt;cstdio&gt; #include&lt;cstring&gt; #include&lt;fstream&gt; #include&lt;cstdlib&gt; #include&lt;iostream&gt; #include&lt;algorithm&gt; #include&lt;unordered_map&gt; using namespace std; #define endl &#039;\\n&#039; #define IOS \\ ios_base::sync_with_stdio(0); \\ cin.tie(0); \\ cout.tie(0); typedef long [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-36","post","type-post","status-publish","format-standard","hentry","category-solution"],"_links":{"self":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/36","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=36"}],"version-history":[{"count":0,"href":"https:\/\/solost.cn\/index.php?rest_route=\/wp\/v2\/posts\/36\/revisions"}],"wp:attachment":[{"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=36"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=36"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/solost.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=36"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}