{"id":8,"date":"2025-11-08T18:09:13","date_gmt":"2025-11-08T10:09:13","guid":{"rendered":"https:\/\/geligeli.xyz\/blog\/?p=8"},"modified":"2026-01-04T11:16:58","modified_gmt":"2026-01-04T03:16:58","slug":"%e5%9f%ba%e6%95%b0%e6%8e%92%e5%ba%8f","status":"publish","type":"post","link":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/2025\/11\/08\/%e5%9f%ba%e6%95%b0%e6%8e%92%e5%ba%8f\/","title":{"rendered":"\u57fa\u6570\u6392\u5e8f"},"content":{"rendered":"\n<pre class=\"wp-block-code\"><code>#include &lt;iostream>\n#include &lt;string>\n#include &lt;vector>\n#include &lt;cmath>\n#include &lt;algorithm>\n\nusing namespace std;\nint n, zui;\nvector&lt;vector&lt;int> > a(10); \nvector&lt;int> nums;\n \nint getnum(int need, int where) {\n\treturn (need \/ (int)pow(10, where)) % 10;\n}\n\nvoid cleara() {\n\tfor (int d9=0;d9&lt;=9;d9++) a&#91;d9].clear();\n}\n\nint main() {\n\tcin >> n;\n\tfor (int d1=0;d1&lt;n;d1++) {\n\t\tint tmp;\n\t\tcin >> tmp;\n\t\t\n\t\tzui = max(zui, (int)(1 + log10(tmp))); \/\/ \u6700\u5927\u4f4d\u6570 \n\t\tnums.push_back(tmp);\n\t\t\n\t}\n\ta.resize(n);\n\tfor (int d2=0;d2&lt;zui;d2++) {\n\t\tcleara();\n\t\tfor (int d5=0;d5&lt;=n;d5++){\n\t\t\tint num = nums&#91;d5];\n\t\t\ta&#91;getnum(num, d2)].push_back(num);\n\t\t} \n\t\tnums.clear();\n\t\tfor (int d3=0;d3&lt;=9;d3++) {\n\t\t\tfor (size_t d4=0;d4&lt;a&#91;d3].size();d4++) {\n\t\t\t\tnums.push_back(a&#91;d3]&#91;d4]);\n\t\t\t}\n\t\t}\n\t}\n\tfor (int d6=1;d6&lt;=n;d6++) {\n\t\tcout &lt;&lt; nums&#91;d6] &lt;&lt; \" \";\n\t}\n\treturn 0;\n}<\/code><\/pre>\n\n\n\n<p>vector&lt;vector&lt;int> > a(10); \u9996\u5148\u5b9a\u4e49\u4e86\u4e00\u4e2a\u4e8c\u7ef4\u6570\u7ec4(vector),\u6b64\u5904\u7684a(10)\u4e2d\u768410\u4e3a\u4e8c\u7ef4\u6570\u7ec4\u7684\u884c\u6570\uff1b<\/p>\n\n\n\n<p>getnum()\u51fd\u6570\u4e3a\u83b7\u53d6\u4e00\u4e2a\u6570\u5b57\u6307\u5b9a\u4f4d\u6570\u7684\u51fd\u6570<\/p>\n","protected":false},"excerpt":{"rendered":"<p>vector&lt;vecto&#8230;<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[],"class_list":["post-8","post","type-post","status-publish","format-standard","hentry","category-c"],"_links":{"self":[{"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/8","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=8"}],"version-history":[{"count":1,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/8\/revisions"}],"predecessor-version":[{"id":9,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/posts\/8\/revisions\/9"}],"wp:attachment":[{"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=8"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=8"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/\u9f50\u6cb3\u4e00\u4e2d.cn\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=8"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}