{"id":141,"date":"2026-10-12T12:17:49","date_gmt":"2026-10-12T04:17:49","guid":{"rendered":"http:\/\/bkxiaohei123.xyz\/?p=141"},"modified":"2026-10-12T12:17:50","modified_gmt":"2026-10-12T04:17:50","slug":"%e6%97%a5%e5%b8%b8%e5%86%99%e9%a2%98%ef%bc%9acf1278b-a-and-b","status":"publish","type":"post","link":"https:\/\/bkxiaohei123.xyz\/index.php\/2026\/10\/12\/%e6%97%a5%e5%b8%b8%e5%86%99%e9%a2%98%ef%bc%9acf1278b-a-and-b\/","title":{"rendered":"\u65e5\u5e38\u5199\u9898\uff1aCF1278B A and B"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\"><a href=\"https:\/\/www.luogu.com.cn\/problem\/CF1278B\">\u9898\u76ee\u94fe\u63a5<\/a><\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9898\u610f\uff1a\u7ed9\u4f60\u4e24\u4e2a\u6570 A\uff0cB\uff0c\u6bcf\u6b21\u5bf9\u4e8e\u7b2ci\u6b21\u64cd\u4f5c\u4f60\u53ef\u4ee5\u9009\u62e9\u5728A\u6216B\u52a0\u4e0ai\uff0c\u6c42\u9700\u8981\u6700\u5c11\u591a\u5c11\u6b21\u64cd\u4f5c\u8ba9A\u7b49\u4e8eB\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u672c\u9898\u8bf4\u5b9e\u8bdd\u9898\u89e3\u5f88\u96be\u7406\u89e3\uff0c\u6240\u4ee5\u6211\u5c3d\u91cf\u4ee5\u7b80\u5355\u7684\u65b9\u5f0f\u63cf\u8ff0\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u9996\u5148\u6211\u4eec\u80fd\u60f3\u5230\u7684\u662f\u5c3d\u91cf\u8ba9\u6240\u6709\u5c0f\u7684\u6570\u52a0\u5230A\u4e0a\u4fdd\u8bc1\u7f29\u5c0fA\u548cB\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4f46\u662f\u6211\u4eec\u53ef\u4ee5\u6a21\u62df\u4e00\u4e0b\u6848\u4f8b<br>A= 1 , B= 3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c1\u6b21\u64cd\u4f5c\uff1aA\u6bd4B\u5c0f\uff0cA\u52a0\u4e0a1   A=2\uff0cB=3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c2\u6b21\u64cd\u4f5c\uff1aA\u6bd4B\u5c0f\uff0cA\u52a0\u4e0a2  A=4\uff0cB=3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6b64\u65f6\u6211\u4eec\u53d1\u73b0A\u5df2\u7ecf\u6bd4B\u5927\u4e86\uff0c\u540e\u9762\u8981\u4ed8\u51fa\u66f4\u591a\u64cd\u4f5c\uff0c\u56e0\u4e3a\u6709\u66f4\u4f18\u64cd\u4f5c\uff1a<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c1\u6b21\u64cd\u4f5c\uff1aA\u52a0\u4e0a1  A=2\uff0cB=3<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c2\u6b21\u64cd\u4f5c\uff1a<strong><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">B\u52a0\u4e0a2<\/mark><\/strong> A=2\uff0cB=5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7b2c3\u6b21\u64cd\u4f5c\uff1aA\u52a0\u4e0a3 A=5\uff0cB=5<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u5c11\u6b21\u6570\u4e3a3\u6b21<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7531\u4ee5\u4e0a\u6848\u4f8b\u53ef\u770b\u51fa\u5373\u4f7fA\u5c0f\u4e8eB\u4e5f\u8981\u628a\u6570\u52a0\u5230B\u4e0a\u4fdd\u8bc1\u5f97\u51fa\u7b54\u6848\u6761\u4ef6<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6240\u4ee5\u6211\u4eec\u53ef\u4ee5\u6362\u4e2a\u601d\u8def\u53bb\u60f3\uff0c\u628a\u8be5\u52a0\u7684\u6570\u5168\u52a0\u5230A\u4e0a\uff0c\u7136\u540e\u518d\u770b\u5e94\u8be5\u628a\u54ea\u4e9b\u6570\u8ba9\u7ed9B\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u7136\u540e\u6211\u4eec\u7ee7\u7eed\u601d\u8003\uff0c\u8be5\u600e\u4e48\u5224\u65adA\u4e0a\u7684\u6570\u8ba9\u51fa\u4e00\u90e8\u5206\u8db3\u591f\u4f7f\u5f97B\u548cA\u76f8\u7b49\u5462\uff1f<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6211\u4eec\u53ef\u4ee5\u770b\u51fa\u6bcf\u6b21\u8ba9\u51fa\u4e00\u4e2a\u6570 i \u65f6A\u548cB\u7684\u4e4b\u95f4\u7684\u5dee\u8ddd\u7f29\u5c0f 2 * i \u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u8fd9\u65f6\u6211\u4eec\u53ef\u4ee5\u5f97\u51fa\u7ed3\u8bba\u5f53A\u5927\u4e8eB\u4e14\u76f8\u5dee\u662f\u5076\u6570\u65f6\u64cd\u4f5c\u6570\u4fbf\u53ef\u6ee1\u8db3\u6761\u4ef6\u3002\u8fd9\u4e00\u6b65\u786e\u5b9e\u5f88\u96be\u7406\u89e3\uff0c\u5efa\u8bae\u591a\u6a21\u62df\u81ea\u5df1\u89c2\u5bdf\u3002<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u6700\u540e\u5728\u89e3\u91ca\u4e00\u4e0b\u4e3a\u4ec0\u4e48\u4e00\u5b9a\u80fdA\u4e0eB\u5dee\u503cC\u5e73\u5206\u6389\uff0c\u56e0\u4e3a C\/2 \u4e00\u5b9a\u5c0f\u4e8ei\u7684\uff0c\u4fdd\u8bc1A\u4e00\u5b9a\u6709\u5305\u542bC\/2\u7684\u6570\u5206\u7ed9B<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">\u4ee5\u4e0b\u9898\u89e3\u4ee3\u7801<\/p>\n\n\n\n<pre class=\"wp-block-code language-cpp\" data-wzcbh-download=\"snippet.cpp\"><code lang=\"cpp\" class=\"language-cpp\">#include&lt;bits\/stdc++.h>\nusing namespace std;\n#define int long long\t\nvoid resolve()\n{\n\tint a, b;\n\tcin >> a >> b;\n\tif (a > b)\n\tswap(a, b);\n\tint i = 0;\n\twhile (a &lt; b || (a - b) % 2 != 0)\n\t{\n\t\ti++;\n\t\ta += i;\n\t}\n\tcout &lt;&lt; i &lt;&lt; endl;\n}\nsigned main() {\n\tios::sync_with_stdio(false);\n\tcin.tie(nullptr);\n\tint T;\n\tcin >> T;\n\twhile (T--)\n\t\tresolve();\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u9898\u76ee\u94fe\u63a5 \u9898\u610f\uff1a\u7ed9\u4f60\u4e24\u4e2a\u6570 A\uff0cB\uff0c\u6bcf\u6b21\u5bf9\u4e8e\u7b2ci\u6b21\u64cd\u4f5c\u4f60\u53ef\u4ee5\u9009\u62e9\u5728A\u6216B\u52a0\u4e0ai\uff0c\u6c42\u9700\u8981\u6700\u5c11\u591a\u5c11\u6b21\u64cd\u4f5c\u8ba9A\u7b49\u4e8eB [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":91,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[14,22,13,25],"class_list":["post-141","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learning","tag-c","tag-22","tag-13","tag-25"],"_links":{"self":[{"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/posts\/141","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/comments?post=141"}],"version-history":[{"count":1,"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/posts\/141\/revisions"}],"predecessor-version":[{"id":142,"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/posts\/141\/revisions\/142"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/media\/91"}],"wp:attachment":[{"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/media?parent=141"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/categories?post=141"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/bkxiaohei123.xyz\/index.php\/wp-json\/wp\/v2\/tags?post=141"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}