{
  "question_id": 7398746,
  "question_title": "可怕的流感 ",
  "question_content": "<p style=\"margin-left:0pt; margin-right:0pt\">Ø 问题描述&#xff1a;已知一只家禽得了流感&#xff0c;流感的传播时间为 24 小时&#xff0c;在这 24 小时内最多能将流感传给其它 M 只家禽&#xff0c;农场主需要购买紧急药品&#xff0c;假设发现时已经过了 N 天&#xff0c;那么农场主需要至少买多少包药呢&#xff1f;&#xff08;一包药为一只家禽用量&#xff09;</p><p style=\"margin-left:0pt; margin-right:0pt\">Ø 输入&#xff1a;一行&#xff0c;两个整数&#xff0c;第一个表示流感传染家禽的数量 M&#xff0c;第二个表示发现时已过的天数。</p><p style=\"margin-left:0pt; margin-right:0pt\">Ø 输出&#xff1a;一行&#xff0c;一个整数&#xff0c;表示需要药的包数。</p><p style=\"margin-left:0pt; margin-right:0pt\">Ø 样例输入&#xff1a;</p><p style=\"margin-left:0pt; margin-right:0pt\">10 2</p><p style=\"margin-left:0pt; margin-right:0pt\">Ø 样例输出&#xff1a;</p><p style=\"margin-left:0pt; margin-right:0pt\">121</p>",
  "difficulty": "困难",
  "answer_id": 53345307,
  "answer_content": "<pre>\n<code class=\"language-cpp\">#include&lt;iostream&gt;\nusing namespace std;\nint total(int x);              //定义函数\nint m;                         //m为感染数\nint main() {\n\tint  x;                     //x为发现天数\n\tcin &gt;&gt; m &gt;&gt; x;\n\tint to &#61; total(x);           //to为结果\n\tcout &lt;&lt; to;\n\treturn 0;\n}\nint total(int x) {\n\tif (x &gt; 0)\n\t{\n\t\treturn (m &#43; 1) * total(x - 1);\n\t}\n\telse return 1;\n}\n</code></pre>\n\n<p> <img alt=\"\" height=\"80\" src=\"https://img-ask.csdnimg.cn/upload/1612343504683.png\" width=\"363\" /></p>",
  "tag_name": "c++",
  "cpp": "#include <iostream>\nusing namespace std;\nint total(int x);\t\t\t  \nint m;\t\t\t\t\t\t \nint main() {\n\tint  x;\t\t\t\t\t \n\tcin >> m >> x;\n\tint to = total(x);\t\t   \n\tcout << to;\n\treturn 0;\n}\nint total(int x) {\n\tif (x > 0)\n\t{\n\t\treturn (m + 1) * total(x - 1);\n\t}\n\telse return 1;\n}",
  "topic_link": "https://bbs.csdn.net/topics/600469842",
  "status": 1,
  "keywords": "算法初阶,快速排序,快速排序分析,期望运行时间,排序和顺序统计量",
  "license": "csdn.net",
  "notebook": {
    "cpp": "https://codechina.csdn.net/csdn/csdn-daily-code/-/jupyter/master/data/notebook/answer/ipynb/cpp/2.ipynb?type=file"
  },
  "notebook_enable": 1,
  "author": "qq_45794342"
}