{"id":154,"date":"2026-03-19T09:31:39","date_gmt":"2026-03-19T01:31:39","guid":{"rendered":"https:\/\/blog.heroking2000.com\/?p=154"},"modified":"2026-03-19T09:31:39","modified_gmt":"2026-03-19T01:31:39","slug":"%e7%8b%a0%e7%8b%a0%e5%9c%b0%e5%88%87%e5%89%b2-hard-version","status":"publish","type":"post","link":"https:\/\/www.heroking2000.com\/?p=154","title":{"rendered":"\u72e0\u72e0\u5730\u5207\u5272 (Hard Version)"},"content":{"rendered":"\n<p>\u73b0\u7ed9\u4f60\u4e00\u4e2a\u957f\u5ea6\u4e3a\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>n<\/mi><\/mrow><\/semantics><\/math>\u7684\u5e8f\u5217\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><msub><mi>a<\/mi><mn>1<\/mn><\/msub><mo separator=\"true\">,<\/mo><mo>\u22ef<\/mo><mtext>\u2009<\/mtext><mo separator=\"true\">,<\/mo><msub><mi>a<\/mi><mi>n<\/mi><\/msub><\/mrow><\/semantics><\/math>\u200b\u548c\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>m<\/mi><\/mrow><\/semantics><\/math>\u4e2a\u4e92\u4e0d\u76f8\u540c\u7684\u6574\u6570\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><msub><mi>b<\/mi><mn>1<\/mn><\/msub><mo separator=\"true\">,<\/mo><mo>\u22ef<\/mo><mtext>\u2009<\/mtext><mo separator=\"true\">,<\/mo><msub><mi>b<\/mi><mi>m<\/mi><\/msub><\/mrow><\/semantics><\/math>\u200b\u3002\u4f60\u9700\u8981\u6309\u7167\u8fd9\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>m<\/mi><\/mrow><\/semantics><\/math>\u4e2a\u6570\u5bf9\u5e8f\u5217\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><\/semantics><\/math>\u8fdb\u884c<strong>\u72e0\u72e0\u5730\u5207\u5272<\/strong>\u3002<\/p>\n\n\n\n<p>\u5177\u4f53\u7684\uff0c\u5bf9\u4e8e\u4e00\u4e2a\u6570\u5b57\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>i<\/mi><mo>\u2208<\/mo><mo stretchy=\"false\">[<\/mo><mn>1<\/mn><mo separator=\"true\">,<\/mo><mi>n<\/mi><mo stretchy=\"false\">]<\/mo><\/mrow><\/semantics><\/math>\uff0c\u5982\u679c\u5b58\u5728\u4e00\u4e2a\u6574\u6570\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>j<\/mi><mo>\u2208<\/mo><mo stretchy=\"false\">[<\/mo><mn>1<\/mn><mo separator=\"true\">,<\/mo><mi>m<\/mi><mo stretchy=\"false\">]<\/mo><\/mrow><\/semantics><\/math>\uff0c\u4f7f\u5f97\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><msub><mi>a<\/mi><mi>i<\/mi><\/msub><mo>=<\/mo><msub><mi>b<\/mi><mi>j<\/mi><\/msub><\/mrow><\/semantics><\/math>\uff0c\u5219\u5c06\u4f4d\u7f6e\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>i<\/mi><\/mrow><\/semantics><\/math>\u79f0\u4e3a\u4e00\u4e2a<strong>\u5207\u5272\u70b9<\/strong>\u3002\u5bf9\u5e8f\u5217\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><\/semantics><\/math>\u4e2d\u7684\u6bcf\u4e00\u4e2a\u5207\u5272\u70b9\uff0c\u6211\u4eec\u5728\u8fd9\u4e2a\u4f4d\u7f6e\u8fdb\u884c\u4e00\u6b21<strong>\u72e0\u72e0\u5730\u5207\u5272<\/strong>\u3002\u65b9\u6cd5\u662f\uff0c\u5c06\u8be5\u4f4d\u7f6e\u7684\u6570\u5b57\u53bb\u9664\uff0c\u7136\u540e\u5728\u8fd9\u4e2a\u4f4d\u7f6e\u5c06\u5176\u5de6\u53f3\u7684<strong>\u5e8f\u5217\/\u7247\u6bb5<\/strong>\u4e00\u5206\u4e24\u534a\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u5bf9<strong>\u72e0\u72e0\u5730\u5207\u5272<\/strong>\u7684\u5b9a\u4e49\u6709\u7591\u95ee\uff0c\u53ef\u4ee5\u53c2\u7167\u300c\u6837\u4f8b #1\u300d\u53ca\u300c\u6837\u4f8b\u89e3\u91ca #1\u300d\u8fdb\u884c\u7406\u89e3\u3002<\/p>\n\n\n\n<p>\u4f60\u9700\u8981\u8ba1\u7b97\uff0c\u5728\u8fdb\u884c\u4e86\u6240\u6709\u53ef\u80fd\u7684<strong>\u72e0\u72e0\u5730\u5207\u5272<\/strong>\u540e\uff0c\u5e8f\u5217\u88ab\u5207\u5272\u4e3a\u4e86\u591a\u5c11<strong>\u7247\u6bb5<\/strong>\u3002<\/p>\n\n\n\n<p>\u7279\u522b\u7684\uff0c\u5982\u679c\u5728\u5207\u5272\u540e\uff0c\u67d0\u4e00\u6bb5\u5185\u6ca1\u6709\u6570\u7ec4\uff0c\u90a3\u8fd9\u4e00\u6bb5\u4e0d\u53ef\u88ab\u53eb\u505a<strong>\u7247\u6bb5<\/strong>\u3002\u540c\u6837\u7684\uff0c\u5982\u679c\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>1<\/mn><\/mrow><\/semantics><\/math>\u6216\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>n<\/mi><\/mrow><\/semantics><\/math>\u4e3a\u5207\u5272\u70b9\uff0c\u5176\u4e0e\u5f00\u5934\u548c\u7ed3\u5c3e\u4e4b\u95f4\u4e5f\u4e0d\u5b58\u5728\u7247\u6bb5\u3002<\/p>\n\n\n\n<p>\u5982\u679c\u5bf9<strong>\u7247\u6bb5<\/strong>\u7684\u6982\u5ff5\u6709\u7591\u95ee\uff0c\u53ef\u4ee5\u53c2\u7167\u300c\u6837\u4f8b #2\u300d\u53ca\u300c\u6837\u4f8b\u89e3\u91ca #2\u300d\u8fdb\u884c\u7406\u89e3\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u683c\u5f0f\u3011<\/p>\n\n\n\n<p>\u7b2c\u4e00\u884c\u4e3a\u4e24\u4e2a\u6574\u6570\uff0c\u4f9d\u6b21\u8868\u793a\u5e8f\u5217\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><\/semantics><\/math>\u7684\u957f\u5ea6\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>n<\/mi><\/mrow><\/semantics><\/math>\u548c\u5e8f\u5217\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><\/semantics><\/math>\u7684\u957f\u5ea6\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>m<\/mi><\/mrow><\/semantics><\/math>\u3002<br>\u7b2c\u4e8c\u884c\u6709\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>n<\/mi><\/mrow><\/semantics><\/math>\u4e2a\u6574\u6570\uff0c\u7b2c\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>i<\/mi><\/mrow><\/semantics><\/math>\u4e2a\u6574\u6570\u8868\u793a\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><msub><mi>a<\/mi><mi>i<\/mi><\/msub><\/mrow><\/semantics><\/math>\u3002<br>\u7b2c\u4e09\u884c\u6709\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>m<\/mi><\/mrow><\/semantics><\/math>\u4e2a\u6574\u6570\uff0c\u7b2c\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>i<\/mi><\/mrow><\/semantics><\/math>\u4e2a\u6574\u6570\u8868\u793a\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><msub><mi>b<\/mi><mi>i<\/mi><\/msub><\/mrow><\/semantics><\/math>\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u51fa\u683c\u5f0f\u3011<\/p>\n\n\n\n<p>\u8f93\u51fa\u4e00\u4e2a\u6574\u6570\uff0c\u4ee3\u8868<strong>\u72e0\u72e0\u5730\u5207\u5272<\/strong>\u540e\u7684<strong>\u7247\u6bb5<\/strong>\u7684\u4e2a\u6570\u3002<\/p>\n\n\n\n<p>\u3010\u8f93\u5165\u8f93\u51fa\u6837\u4f8b#1\u3011<\/p>\n\n\n\n<p>\u8f93\u5165#1<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">6 2\n3 4 3 5 2 6\n5 4<\/pre>\n\n\n\n<p>\u8f93\u51fa#1<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">3<\/pre>\n\n\n\n<p>\u3010\u8f93\u5165\u8f93\u51fa\u6837\u4f8b#2\u3011<\/p>\n\n\n\n<p>\u8f93\u5165#2<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">6 3\n3 4 3 5 2 6\n3 5 6<\/pre>\n\n\n\n<p>\u8f93\u51fa#2<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2<\/pre>\n\n\n\n<p>\u3010\u8bf4\u660e\u63d0\u793a\u3011<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a><\/a>\u6837\u4f8b 1 \u89e3\u91ca<\/h3>\n\n\n\n<p>\u5728<strong>\u72e0\u72e0\u5730\u5207\u5272<\/strong>\u524d\uff0c\u5e8f\u5217&nbsp;<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><\/semantics><\/math><em>a<\/em><\/p>\n\n\n\n<p>\u5982\u4e0b\u6240\u793a\uff1a<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mtable rowspacing=\"0.15999999999999992em\" columnspacing=\"1em\"><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>3<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>4<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>3<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>5<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>2<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>6<\/mn><\/mstyle><\/mtd><\/mtr><\/mtable><\/semantics><\/math><\/p>\n\n\n\n<p>\u200b<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mtable rowspacing=\"0.15999999999999992em\" columnspacing=\"1em\"><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>3<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>3<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>2<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>6<\/mn><\/mstyle><\/mtd><\/mtr><\/mtable><\/semantics><\/math><\/p>\n\n\n\n<p>\u200b<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mtable rowspacing=\"0.15999999999999992em\" columnspacing=\"1em\"><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mover><mover><mn>3<\/mn><mo stretchy=\"true\">\u23de<\/mo><\/mover><mtext>\u7247\u6bb5&nbsp;1<\/mtext><\/mover><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mover><mover><mn>3<\/mn><mo stretchy=\"true\">\u23de<\/mo><\/mover><mtext>\u7247\u6bb5&nbsp;2<\/mtext><\/mover><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mover><mover><mrow><mn>2<\/mn><mspace width=\"1em\"><\/mspace><mn>6<\/mn><\/mrow><mo stretchy=\"true\">\u23de<\/mo><\/mover><mtext>\u7247\u6bb5&nbsp;3<\/mtext><\/mover><\/mstyle><\/mtd><\/mtr><\/mtable><\/semantics><\/math><\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a><\/a>\u6837\u4f8b 2 \u89e3\u91ca<\/h3>\n\n\n\n<p>\u4ee5\u4e0b\u6211\u4eec\u5c55\u793a\u53bb\u9664\u4e4b\u540e\u7684\u5e8f\u5217\uff1a<\/p>\n\n\n\n<p><math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mtable rowspacing=\"0.15999999999999992em\" columnspacing=\"1em\"><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>4<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mn>2<\/mn><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><\/mtr><\/mtable><\/semantics><\/math><\/p>\n\n\n\n<p>\u200b<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mtable rowspacing=\"0.15999999999999992em\" columnspacing=\"1em\"><mtr><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mrow><mover><mover><mpadded width=\"0px\"><mphantom><mn><\/mn><\/mphantom><\/mpadded><mo stretchy=\"true\">\u23de<\/mo><\/mover><mstyle mathcolor=\"red\"><mtext>\u8fd9\u4e2a\u4e0d\u662f\u7247\u6bb5<\/mtext><\/mstyle><\/mover><mi mathvariant=\"normal\">\u2223<\/mi><\/mrow><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mover><mover><mn>4<\/mn><mo stretchy=\"true\">\u23de<\/mo><\/mover><mtext>\u7247\u6bb5&nbsp;1<\/mtext><\/mover><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mover><mover><mpadded width=\"0px\"><mphantom><mn><\/mn><\/mphantom><\/mpadded><mo stretchy=\"true\">\u23de<\/mo><\/mover><mstyle mathcolor=\"red\"><mtext>\u8fd9\u4e2a\u4e0d\u662f\u7247\u6bb5<\/mtext><\/mstyle><\/mover><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mi mathvariant=\"normal\">\u2223<\/mi><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mover><mover><mn>2<\/mn><mo stretchy=\"true\">\u23de<\/mo><\/mover><mtext>\u7247\u6bb5&nbsp;2<\/mtext><\/mover><\/mstyle><\/mtd><mtd><mstyle scriptlevel=\"0\" displaystyle=\"false\"><mrow><mi mathvariant=\"normal\">\u2223<\/mi><mover><mover><mpadded width=\"0px\"><mphantom><mn><\/mn><\/mphantom><\/mpadded><mo stretchy=\"true\">\u23de<\/mo><\/mover><mstyle mathcolor=\"red\"><mtext>\u8fd9\u4e2a\u4e0d\u662f\u7247\u6bb5<\/mtext><\/mstyle><\/mover><\/mrow><\/mstyle><\/mtd><\/mtr><\/mtable><\/semantics><\/math>\u200b<\/p>\n\n\n\n<h3 class=\"wp-block-heading\"><a><\/a>\u6570\u636e\u89c4\u6a21\u4e0e\u7ea6\u5b9a<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li>\u5bf9\u4e8e\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>30<\/mn><mi mathvariant=\"normal\">%<\/mi><\/mrow><\/semantics><\/math>\u7684\u6570\u636e\uff0c\u4fdd\u8bc1\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><\/semantics><\/math>\u5e8f\u5217\u4e2d\u6ca1\u6709\u4efb\u4f55\u5143\u7d20\u5728\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><\/semantics><\/math>\u4e2d\u51fa\u73b0\u8fc7\u3002\u5f62\u5f0f\u5316\u7684\uff0c<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi mathvariant=\"normal\">\u2200<\/mi><mi>i<\/mi><mo>\u2208<\/mo><mo stretchy=\"false\">[<\/mo><mn>1<\/mn><mo separator=\"true\">,<\/mo><mi>n<\/mi><mo stretchy=\"false\">]<\/mo><mo separator=\"true\">,<\/mo><mi mathvariant=\"normal\">\u2200<\/mi><mi>j<\/mi><mo>\u2208<\/mo><mo stretchy=\"false\">[<\/mo><mn>1<\/mn><mo separator=\"true\">,<\/mo><mi>m<\/mi><mo stretchy=\"false\">]<\/mo><mo separator=\"true\">,<\/mo><msub><mi>a<\/mi><mi>i<\/mi><\/msub><mo mathvariant=\"normal\">\u2260<\/mo><msub><mi>b<\/mi><mi>j<\/mi><\/msub><\/mrow><\/semantics><\/math>\u3002<\/li>\n\n\n\n<li>\u5bf9\u4e8e\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>100<\/mn><mi mathvariant=\"normal\">%<\/mi><\/mrow><\/semantics><\/math>\u7684\u6570\u636e\uff0c\u4fdd\u8bc1\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mn>1<\/mn><mo>\u2264<\/mo><mi>n<\/mi><mo separator=\"true\">,<\/mo><mi>m<\/mi><mo>\u2264<\/mo><mn>5<\/mn><mo>\u00d7<\/mo><mn>1<\/mn><msup><mn>0<\/mn><mn>5<\/mn><\/msup><\/mrow><\/semantics><\/math>\uff0c<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mo>\u2212<\/mo><mn>1<\/mn><msup><mn>0<\/mn><mn>18<\/mn><\/msup><mo>\u2264<\/mo><msub><mi>a<\/mi><mi>i<\/mi><\/msub><mo separator=\"true\">,<\/mo><msub><mi>b<\/mi><mi>i<\/mi><\/msub><mo>\u2264<\/mo><mn>1<\/mn><msup><mn>0<\/mn><mn>18<\/mn><\/msup><\/mrow><\/semantics><\/math>\uff0c\u5e8f\u5217\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><\/semantics><\/math>\u4e2d\u7684\u5143\u7d20\u4e24\u4e24\u4e0d\u540c\u3002<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\"><a><\/a>\u63d0\u793a<\/h3>\n\n\n\n<p>\u672c\u9898\u8f93\u5165\u89c4\u6a21\u8f83\u5927\uff0c\u5efa\u8bae\u8003\u8651\u4f7f\u7528\u8f83\u5feb\u7684\u8bfb\u5165\u8bfb\u51fa\u65b9\u5f0f\u3002<\/p>\n\n\n\n<p>\u3010\u89e3\u9898\u601d\u8def\u3011<\/p>\n\n\n\n<p>\u5148\u5c06<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><\/semantics><\/math>\u5e8f\u5217\u6392\u5e8f\uff0c\u4fbf\u4e8e\u540e\u7eed\u67e5\u627e\u3002\u7136\u540e\u904d\u5386\u00a0<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>a<\/mi><\/mrow><\/semantics><\/math>\u5e8f\u5217,\u901a\u8fc7\u4e8c\u5206\u67e5\u627e\u6cd5\u5224\u65ad\u662f\u5426\u5728<math xmlns=\"http:\/\/www.w3.org\/1998\/Math\/MathML\"><semantics><mrow><mi>b<\/mi><\/mrow><\/semantics><\/math>\u5e8f\u5217\u4e2d\u3002\u5b58\u5728\u5373\u5206\u5272\uff0c\u5faa\u73af\u8ba1\u6570<\/p>\n\n\n\n<p>\u3010\u4ee3\u7801\u6837\u4f8b\u3011<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>#include &lt;bits\/stdc++.h>\nusing namespace std;\nconst int MAXN = 5 * 1e5 + 5;\nlong long a&#91;MAXN];\nlong long b&#91;MAXN];\nint n, m;\n\nbool isdivide(long long x) {\n\tauto i = lower_bound(b + 1, b + m + 1, x) - b;\n\tif (x == b&#91;i]) {\n\t\treturn true;\n\t} else {\n\t\treturn false;\n\t}\n}\n\nint main() {\n\tcin >> n >> m;\n\tfor (int i = 1; i &lt;= n; i++) {\n\t\tcin >> a&#91;i];\n\t}\n\tfor (int i = 1; i &lt;= m; i++) {\n\t\tcin >> b&#91;i];\n\t}\n\tsort(b + 1, b + m + 1); \/\/\u6392\u5e8f\n\tint t = 0;\n\tint cnt = 0; \/\/\u8ba1\u6570\n\tfor (int i = 1; i &lt;= n; i++) {\n\t\tif (isdivide(a&#91;i])) {\n\t\t\tif (t > 0) {\n\t\t\t\tcnt++;\n\t\t\t\tt = 0;\n\t\t\t}\n\t\t} else {\n\t\t\tt++;\n\t\t}\n\t}\n\tif (t > 0) {\n\t\tcnt++;\n\t}\n\tcout &lt;&lt; cnt &lt;&lt; endl;\n\n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u73b0\u7ed9\u4f60\u4e00\u4e2a\u957f\u5ea6\u4e3a\u00a0n\u7684\u5e8f\u5217\u00a0a1,\u22ef\u2009,an\u200b\u548c\u00a0m\u4e2a\u4e92\u4e0d\u76f8\u540c\u7684\u6574\u6570\u00a0b1,\u22ef\u2009,bm\u200b\u3002\u4f60\u9700\u8981\u6309\u7167\u8fd9\u00a0m\u4e2a\u6570 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[22],"tags":[24,25],"class_list":["post-154","post","type-post","status-publish","format-standard","hentry","category-oi","tag-24","tag-25"],"_links":{"self":[{"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts\/154","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=154"}],"version-history":[{"count":1,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions"}],"predecessor-version":[{"id":155,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=\/wp\/v2\/posts\/154\/revisions\/155"}],"wp:attachment":[{"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=154"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=154"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.heroking2000.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=154"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}