{"id":40,"date":"2025-02-12T22:14:27","date_gmt":"2025-02-12T14:14:27","guid":{"rendered":"https:\/\/liyongquan.cn\/?p=40"},"modified":"2025-02-12T22:58:54","modified_gmt":"2025-02-12T14:58:54","slug":"cf1004-div-2-a","status":"publish","type":"post","link":"https:\/\/liyongquan.cn\/?p=40","title":{"rendered":"cf1004.div.2.A"},"content":{"rendered":"\n<div class=\"wp-block-buttons is-layout-flex wp-block-buttons-is-layout-flex\">\n<div class=\"wp-block-button\"><a class=\"wp-block-button__link wp-element-button\" href=\"https:\/\/codeforces.com\/contest\/2067\/problem\/A\">\u9898\u76ee<\/a><\/div>\n<\/div>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code>#include&lt;bits\/stdc++.h&gt;\nusing namespace std;\nint x,n,m;\nint main(){\n\t\/\/freopen(\"in.txt\",\"r\",stdin); \n\t\/\/freopen(\"out.txt\",\"w\",stdout); \n\tcin&gt;&gt;x;\n\twhile(x--){\n\tcin&gt;&gt;n&gt;&gt;m;\n\tif(m&gt;n){\n\t\tif(abs(n-m)==1)cout&lt;&lt;\"Yes\"&lt;&lt;endl;\n\t\telse cout&lt;&lt;\"No\"&lt;&lt;endl;\n\t}\n\telse {\n\t\tif((n+1-m)&gt;0&amp;&amp;(n+1-m)%9==0)cout&lt;&lt;\"Yes\"&lt;&lt;endl;\n\t\telse cout&lt;&lt;\"No\"&lt;&lt;endl;\n\t}\n\t\n\t\n\t}return 0;\n}<\/code><\/pre>\n\n\n\n<p>\u5206\u7c7b\u8ba8\u8bban&gt;m,n&lt;m\u60c5\u51b5\uff08\u6613\u5f97n\uff01=m\uff09\uff0cn&lt;m\u65f6\u5fc5\u7136\u6700\u540e\u4e00\u4f4d\u4e0d\u4e3a9,\u6613\u5f97\u4ee3\u7801<\/p>\n\n\n\n<p>n&gt;m\u65f6\uff0cx\u4e00\u5b9a\u662f\u7531k\u4e2a\u8fde\u7eed\u76849\u7ec4\u6210\u672b\u4f4d\uff0c\u6ce8\u610f\u5230\u5f53x+1\u65f6\uff0cS(x+1)=S(x)+1-9k<\/p>\n\n\n\n<p>\u5373m=n+1-9k,k\u4e3a\u6b63\u6574\u6570\uff08\u6613\u5f97\uff09\uff0c\u5219\u82e5(n+1-m)&gt;0&amp;&amp;(n+1-m)%9==0\u65f6\u6210\u7acb<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5206\u7c7b\u8ba8\u8bban&gt;m,n&lt;m\u60c5\u51b5\uff08\u6613\u5f97n\uff01=m\uff09\uff0cn&lt;m\u65f6\u5fc5\u7136\u6700\u540e\u4e00\u4f4d\u4e0d\u4e3a9,\u6613\u5f97\u4ee3\u7801 n&gt; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[4],"tags":[],"class_list":["post-40","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/liyongquan.cn\/index.php?rest_route=\/wp\/v2\/posts\/40","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/liyongquan.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/liyongquan.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=40"}],"version-history":[{"count":3,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions"}],"predecessor-version":[{"id":64,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=\/wp\/v2\/posts\/40\/revisions\/64"}],"wp:attachment":[{"href":"https:\/\/liyongquan.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=40"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=40"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=40"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}