{"id":459,"date":"2024-05-05T09:00:00","date_gmt":"2024-05-05T01:00:00","guid":{"rendered":"https:\/\/seanxd.com\/?p=459"},"modified":"2024-05-03T21:17:14","modified_gmt":"2024-05-03T13:17:14","slug":"zerojudge-i859","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-i859\/","title":{"rendered":"ZeroJudge I859: Can You Solve It?"},"content":{"rendered":"\n\n\n<h4 class=\"wp-block-heading\">\u540c\u984c\uff1aUVa 10642 &#8211; Can You Solve It?<\/h4>\n\n\n\n<p class=\"\">\u4e0b\u9762\u9019\u5f35\u5716\uff0c\u6bcf\u500b\u5713\u90fd\u6709\u4e00\u500b\u5750\u6a19\uff0c\u6839\u64da\u7b1b\u5361\u723e\u5750\u6a19\u7cfb\uff0c\u60a8\u53ef\u4ee5\u6309\u7167\u4ee5\u4e0b\u6240\u793a\u7684\u7bad\u982d\u8def\u5f91\u5f9e\u4e00\u500b\u5713\u5708\u79fb\u52d5\u5230\u53e6\u4e00\u500b\u5713\u5708\u3002<\/p>\n\n\n\n<p class=\"\">total_number_of_step(s)_needed = number_of_intermediate_circles_you_pass + 1<\/p>\n\n\n\n<p class=\"\">\u4f8b\u5982\uff0c\u8981\u5f9e (0, 3) \u5230 (3, 0)\uff0c\u60a8\u5fc5\u9808\u7d93\u904e\u5169\u500b\u4e2d\u9593\u5713 (1, 2) \u548c (2, 1)\u3002 \u6240\u4ee5\uff0c\u5728\u9019\u7a2e\u60c5\u6cc1\u4e0b\uff0c\u6240\u9700\u7684\u7e3d\u6b65\u6578\u662f 2 + 1 = 3\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter size-full\"><img decoding=\"async\" width=\"654\" height=\"572\" loading=\"lazy\" src=\"https:\/\/seanxd.com\/wp-content\/uploads\/2024\/05\/Can-You.png\" alt=\"ZeroJudge I859 \u984c\u76ee\u6558\u8ff0\u7528\u5716\" class=\"wp-image-460\" srcset=\"https:\/\/seanxd.com\/wp-content\/uploads\/2024\/05\/Can-You.png 654w, https:\/\/seanxd.com\/wp-content\/uploads\/2024\/05\/Can-You-300x262.png 300w\" sizes=\"auto, (max-width: 654px) 100vw, 654px\" \/><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u7bc4\u4f8b\u6e2c\u8cc7<\/h2>\n\n\n\n<figure class=\"wp-block-table nfd-wb-animate nfd-wb-fade-in-bottom-short\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7bc4\u4f8b\u8f38\u5165<\/th><th>\u7bc4\u4f8b\u8f38\u51fa<\/th><\/tr><\/thead><tbody><tr><td>\u7b2c\u4e00\u884c\u70ba\u4e00\u500b\u6574\u6578 N \u4ee3\u8868\u6e2c\u8a66\u8cc7\u6599\u6578\u91cf<br>\u63a5\u4e0b\u4f86 N \u884c\uff0c\u6bcf\u884c\u5305\u542b 4 \u500b\u6574\u6578 x1\u3001y1\u3001x2\u3001y2 (0 \u2264 x1, y1, x2, y2 \u2264 100000)<br>(x1, y1) \u4ee3\u8868\u8d77\u59cb\u5ea7\u6a19<br>(x2, y2) \u4ee3\u8868\u76ee\u6a19\u5ea7\u6a19<\/td><td>\u5c0d\u65bc\u6bcf\u7b46\u6e2c\u8a66\u8cc7\u6599\uff0c\u8acb\u7167\u683c\u5f0f\u8f38\u51fa\u662f\u7b2c\u5e7e\u7b46<br>\u4ee5\u53ca\u8981\u82b1\u8cbb\u7684\u6700\u5c0f\u6b65\u6578<\/td><\/tr><tr><td>3<br>0  0  0  1<br>0  0  1  0<br>0  0  0  2<\/td><td>Case 1: 1<br>Case 2: 2<br>Case 3: 3<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u984c\u601d\u8def<\/h2>\n\n\n\n<p class=\"\">\u5982\u679c\u628a\u6b65\u6578\u6a19\u51fa\u4f86\u7684\u8a71\uff0c\u53ef\u4ee5\u767c\u73fe Y \u8ef8 (\u6a6b\u8ef8) \u7684\u6b65\u6578\u662f 0 &#8211;> 1 &#8211;> 3 &#8211;> 5 &#8211;> 9\uff0c\u4ee5\u6b64\u985e\u63a8\u3002\u8209\u4f8b\u4f86\u8aaa\uff0c\u7576 x + y \u7b49\u65bc 2 \u7684\u6642\u5019\uff0c\u53ef\u4ee5\u767c\u73fe\u9019\u4e9b\u9ede\u90fd\u843d\u5728 (0, 2) \u9019\u500b\u9ede\u7684\u659c\u7dda\u4e0a\uff0c\u66f4\u53ef\u4ee5\u767c\u73fe (1, 1) \u9019\u500b\u9ede\u662f (0, 2) \u7684\u6b65\u6578\uff0b1\uff0c\u4e5f\u5c31\u662f\u5176x\u5ea7\u6a19\u3002\u540c\u7406\uff0c(2, 0) \u7684\u6b65\u6578\u5c31\u662f (0, 2) \u7684\u6b65\u6578\uff0b2\u3002<\/p>\n\n\n\n<figure class=\"wp-block-image aligncenter is-resized\"><a href=\"https:\/\/www.blogger.com\/blog\/post\/edit\/437195052981631268\/9181104114350558633#\" target=\"_blank\" rel=\"noopener\"><img decoding=\"async\" loading=\"lazy\" src=\"https:\/\/blogger.googleusercontent.com\/img\/b\/R29vZ2xl\/AVvXsEjnLmhd6_V2ALc1XAw2GVfsn6ioY7tCJZFKG3mF4Th3lfhMtjwHca_wjuCq8TmyHZHfWGNYQFbRxn31cuHgZzBdc7RrEMY5i2QYIXR1HWtr8rNATnG7Be7SgGh6liD16gDPk7GGe2XKyOIXaS2BgzPfY1XAtldqwKQnBnf81pFlLuLnerIH3M-D7_MLGdg\/s320\/Can%20You.png\" alt=\"ZeroJudge I859 \u89e3\u984c\u601d\u8def\u89e3\u8aaa\u7528\u5716\" style=\"width:460px;height:auto\"\/><\/a><\/figure>\n\n\n\n<p class=\"\">\u53ef\u4ee5\u5148\u8a2d\u5b9a\u4e00\u500b\u9663\u5217\uff0c\u4e26\u5c07 0\u30011\u30013\u30016\u300110\uff0e\uff0e\uff0e\u7b49\u6578\u5b57\u5b58\u653e\u5230 Y \u5ea7\u6a19 (\u6a6b\u8ef8) \u7684\u4f4d\u7f6e\u4e0a\u3002\u6536\u8cc7\u6599\u7684\u6642\u5019\u5224\u65b7 x + y \u662f\u591a\u5c11\u5c31\u627e\u9019\u500b\u4f4d\u7f6e\u7684\u6b65\u6578\u7136\u5f8c\u52a0\u4e0ax\u5ea7\u6a19\u7684\u503c\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=i859\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge I859: Can You Solve It?<\/a><\/h3>\n\n\n\n<div class=\"hcb_wrap nfd-wb-animate nfd-wb-reveal-right nfd-delay-50\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>#include &lt;iostream&gt;\n#include &lt;vector&gt;\nusing namespace std;\n\nint main() {\n    cin.sync_with_stdio(0);\n    cin.tie(0);\n    vector&lt;long long int&gt;Chueh;\n    long long int count = 0, add = 0;\n    for (int i = 0; i&lt;=200000; i++)\n    {\n        count += add;\n        Chueh.push_back(count);\n        add++;\n    }\n    int N;\n    cin &gt;&gt; N;\n    for (int i = 0; i&lt;N; i++)\n    {\n        long long int a, b;\n        cin &gt;&gt; a &gt;&gt; b;\n        long long int start = Chueh[a+b] + a;\n        cin &gt;&gt; a &gt;&gt; b;\n        long long int finish = Chueh[a+b] + a;\n        cout &lt;&lt; &quot;Case &quot; &lt;&lt; i+1 &lt;&lt; &quot;: &quot; &lt;&lt; finish-start &lt;&lt; &quot;\\n&quot;;\n    }\n}\n\n\/\/ZeroJudge I859\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u540c\u984c\uff1aUVa 10642 &#8211; Can You Solve It? \u4e0b\u9762\u9019\u5f35\u5716\uff0c\u6bcf\u500b\u5713\u90fd\u6709\u4e00\u500b\u5750\u6a19\uff0c [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[18],"tags":[15,20,9],"class_list":["post-459","post","type-post","status-publish","format-standard","hentry","category-uva","tag-long-long-int","tag-20","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/459","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/comments?post=459"}],"version-history":[{"count":1,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/459\/revisions"}],"predecessor-version":[{"id":461,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/459\/revisions\/461"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=459"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=459"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=459"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}