{"id":68,"date":"2025-02-13T09:15:22","date_gmt":"2025-02-13T01:15:22","guid":{"rendered":"https:\/\/liyongquan.cn\/?p=68"},"modified":"2025-02-16T23:10:42","modified_gmt":"2025-02-16T15:10:42","slug":"cf1004-div2-c","status":"publish","type":"post","link":"https:\/\/liyongquan.cn\/?p=68","title":{"rendered":"cf1004.div2.C"},"content":{"rendered":"\n<p><a href=\"https:\/\/codeforces.com\/contest\/2067\/problem\/C\" target=\"_blank\" rel=\"noreferrer noopener\">https:\/\/codeforces.com\/contest\/2067\/problem\/C<\/a><\/p>\n\n\n\n<pre class=\"wp-block-code\" style=\"font-size:16px\"><code>#include&lt;bits\/stdc++.h&gt;\nusing namespace std;\n\/\/\u66b4\u529b\nlong long chm&#91;11]={0,9,99,999,9999,99999,999999,9999999,99999999,999999999,9999999999};\nlong long mi&#91;11]={1,10,100,1000,10000,100000,1000000,10000000,100000000,1000000000,10000000000};\nlong long n,t,stp=10;\nint xx=1;\nint pos(long long x,long long y){\/\/\u4ece\u53f3\u5f80\u5de6\u6570\u4f4d\u6570\n\tlong long a,b;\n\ta=x%mi&#91;y];\n\tb=x%mi&#91;y-1];\n\tif(x\/mi&#91;y-1]&lt;1)return 10;\n\telse return (a-b)\/mi&#91;y-1];\n}\/\/\u8fd4\u56de\u4f4d\u6570\nlong long a&#91;10008];\nint main(){\n\t\/\/freopen(\"in.txt\",\"r\",stdin); \n\t\/\/freopen(\"out.txt\",\"w\",stdout); \n\tcin&gt;&gt;t;long long ans,stp1;\n\twhile(t--){\n\t\tcin&gt;&gt;n;stp=10;\n\t\tfor(int i =1;i&lt;=10;i++){\n\t\t\tans=0;xx=1;stp1=0;long long flag = n;\n\t\t\twhile(xx){\n\t\t\t\tfor(int j=1;j&lt;=10;j++){\n\t\t\t\t\t\n\t\t\t\t\tif(pos(flag,j)==7){ans=1;}\n\t\t\t\t\t\t\n\t\t\t\t\t\n\t\t\t\t}\n\t\t\t\tif(ans==0){stp1++;flag+=chm&#91;i];}\n\t\t\t\telse {stp=min(stp,stp1);xx=0;}\n\t\t\t\t\n\t\t\t}\n\t\t\t\/\/cout&lt;&lt;ans&lt;&lt;\" \"&lt;&lt;stp&lt;&lt;endl;\n\t\t}cout&lt;&lt;stp&lt;&lt;endl;\n\n\t}\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<p>    \u6253\u4e86\u62112\u4e2a\u5c0f\u65f6\uff0c\u7528\u8d2a\u5fc3\u5373\u53ef\uff0c\u6211\u4e5f\u4e0d\u4f1a\u8bc1\u3002<br>    \u6253\u66b4\u529b\u5f88\u591a\u5751\uff08\u5176\u4ed6\u65b9\u6cd5\u6211\u60f3\u4e0d\u51fa\u6765\uff09\u8bb0\u5f97\u5f00longlong\uff0c\u5bf9\u6bcf\u4e2a9,99,99&#8230;.\u52a0\u6cd5\u7684\u65f6\u5019\u8bb0\u5f97\u591a\u5f00\u51e0\u4e2a\u5faa\u73af\uff0c<s>\u5bf9\u4f4d\u6570\u4e5f\u5bf9\u5f00\u51e0\u4e2a\u5faa\u73af\uff0c\u55ef\u5c31\u8fd9<\/s>\u8279\u4e0d\u5bf9\uff0cfor\uff08j\uff09\u5c06j\u5f00\u523011\u5c31\u4e0d\u884c\u4e86\uff0c10\u6b63\u597d\uff0c\u8349\u62df\u5417\u4e0d\u7ba1\u4e86,\u80fd\u8fc7\u5c31\u884c<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/codeforces.com\/contest\/2067\/problem\/C \u6253\u4e86\u62112\u4e2a\u5c0f\u65f6\uff0c\u7528 [&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-68","post","type-post","status-publish","format-standard","hentry","category-4"],"_links":{"self":[{"href":"https:\/\/liyongquan.cn\/index.php?rest_route=\/wp\/v2\/posts\/68","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=68"}],"version-history":[{"count":8,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=\/wp\/v2\/posts\/68\/revisions"}],"predecessor-version":[{"id":83,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=\/wp\/v2\/posts\/68\/revisions\/83"}],"wp:attachment":[{"href":"https:\/\/liyongquan.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=68"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=68"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/liyongquan.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=68"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}