{"id":271965,"date":"2016-01-12T12:07:02","date_gmt":"2016-01-12T09:07:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=271965"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=271965","title":{"rendered":"\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432\u2026 \u0432\u0441\u0451-\u0442\u0430\u043a\u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043d\u043e"},"content":{"rendered":"<p>       \u0420\u0430\u043d\u0435\u0435, \u0432 \u0442\u0440\u0451\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0431\u044b\u043b\u0430 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u0430 \u0442\u0435\u043c\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/post\/274689\/\">\u0420\u0430\u0441\u0447\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0421\u0438 (\u0421++)<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/274729\/\">\u0420\u0430\u0441\u0447\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0424\u0443\u0440\u044c\u0435-\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/274889\/\">\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432\u2026 \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/a><\/p>\n<p>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0430\u0432\u0442\u043e\u0440 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0447\u0438\u0441\u0442\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440-\u0442\u043e \u043d\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0443\u0436\u0435\u043d. \u0425\u0432\u0430\u0442\u0438\u0442 \u0431\u0443\u043c\u0430\u0433\u0438, \u0440\u0443\u0447\u043a\u0438, \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430 <s>\u0438 \u043f\u0438\u0432\u0430<\/s>. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043d\u043e \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u043e\u0441\u044f\u0433\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.<br \/>  <a name=\"habracut\"><\/a>  <\/p>\n<h4>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c<\/h4>\n<p>  \u0412 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445 \u043a \u0441\u0442\u0430\u0442\u044c\u0435 \u0430\u0432\u0442\u043e\u0440\u0443 \u043f\u043e\u043f\u0435\u043d\u044f\u043b\u0438 \u0437\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0444\u043e\u0440\u043c\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u041f\u043e\u0441\u043b\u0435 \u043d\u0435\u0434\u043e\u043b\u0433\u0438\u0445 \u0440\u0430\u0437\u043c\u044b\u0448\u043b\u0435\u043d\u0438\u0439 \u043d\u0430\u0440\u0438\u0441\u043e\u0432\u0430\u043b\u043e\u0441\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0435.<\/p>\n<p>  \u041f\u0440\u0438 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0438 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043f\u043e\u0441\u043b\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u044b \u043a \u0432\u0438\u0434\u0443:<\/p>\n<p>  <b>C(n, k) = \u041f(n, k+1) \/ \u041f(1, n-k)<\/b> <\/p>\n<p>  \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0434\u0440\u043e\u0431\u044c, \u043a\u043e\u0442\u043e\u0440\u0443\u044e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c. \u041a\u0430\u043a \u043f\u0440\u043e\u0449\u0435 \u0432\u0441\u0435\u0433\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u0434\u0440\u043e\u0431\u044c \u0432 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430\u0445? \u0420\u0430\u0437\u043b\u043e\u0436\u0438\u0442\u044c \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438. \u0414\u0435\u043b\u043e \u043e\u0431\u043b\u0435\u0433\u0447\u0430\u0435\u0442\u0441\u044f \u0442\u0435\u043c, \u0447\u0442\u043e \u0432 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435, \u0438 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f\u043c\u0438 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u0447\u0438\u0441\u0435\u043b. \u0422.\u0435. \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u0441\u043e\u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u0439 \u043f\u043e \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u043d\u0430\u043a\u0430\u043f\u043b\u0438\u0432\u0430\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432 \u0432\u0438\u0434\u0435 \u0441\u043f\u0438\u0441\u043a\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u043c\u0438 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f\u043c\u0438 \u0441\u0442\u0435\u043f\u0435\u043d\u0438.<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c, \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0434\u043b\u044f \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044f, \u0431\u0435\u0440\u0451\u043c \u043a\u0430\u0436\u0434\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0438 \u0438\u0437 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u0435 \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u0435. \u0418\u0441\u0445\u043e\u0434\u044f \u0438\u0437 \u0444\u0430\u043a\u0442\u0430, \u0447\u0442\u043e \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0439 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 \u2014 \u0447\u0438\u0441\u043b\u043e \u0446\u0435\u043b\u043e\u0435, \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0434\u043e\u043b\u0436\u0435\u043d \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c\u0441\u044f \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e, \u0442.\u0435 \u0441\u0442\u0430\u0442\u044c \u0440\u0430\u0432\u043d\u044b\u043c 1.<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u0448\u0430\u0433: \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u043f\u043e \u0441\u043f\u0438\u0441\u043a\u0443, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0434\u043b\u044f \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f \u043d\u0430 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435, \u0438 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u0432\u0441\u0435 \u0447\u0438\u0441\u043b\u0430, \u0432\u043e\u0437\u0432\u0435\u0434\u0451\u043d\u043d\u044b\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u044d\u0442\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443.<\/p>\n<h4>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/h4>\n<p>  \u0425\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u0430\u0440\u044b \u00ab\u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u2014 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u0438\u00bb \u0431\u044b\u043b\u043e \u0440\u0435\u0448\u0435\u043d\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u0435 <b>map<\/b>, \u0433\u0434\u0435 \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043b\u044e\u0447\u043e\u043c, \u0430 \u043f\u043e\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u2014 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435\u043c.<\/p>\n<p>  \u0414\u043b\u044f \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u0447\u0438\u0441\u0435\u043b \u0431\u044b\u043b \u0432\u0437\u044f\u0442 \u0441\u0430\u043c\u044b\u0439 \u043f\u0440\u0438\u043c\u0438\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c. \u0414\u043b\u044f \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u0438 \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f, \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0444\u0430\u043a\u0442\u043e\u0440\u0438\u0437\u0430\u0446\u0438\u0438 \u043f\u043e \u0441\u0441\u044b\u043b\u043a\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u0451\u0442\u0441\u044f \u0432\u043d\u0435\u0448\u043d\u0438\u0439 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440.<\/p>\n<pre><code class=\"cpp\">#include &lt;iostream&gt; #include &lt;map&gt;  using namespace std;  typedef unsigned long long ullong;  \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u043b\u0430 \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438. \/\/ \u0412 \u043a\u0430\u0447\u0435\u0441\u0442\u0432\u0435 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u0438 \/\/ \u0441\u0441\u044b\u043b\u043a\u0443 \u043d\u0430 \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440 map, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0432 \u0432\u0438\u0434\u0435: \/\/ \u043a\u043b\u044e\u0447 - \u043f\u0440\u043e\u0441\u0442\u043e\u0435 \u0447\u0438\u0441\u043b\u043e, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 - \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u044d\u0442\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432 \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u0438.  template &lt;typename integral_type&gt; void factorize(integral_type num, map&lt;integral_type, unsigned int&gt;& res) {  \tintegral_type j = 2; \twhile (num \/ integral_type(2) &gt;= j) { \t\tif (num % j == 0) { \t\t\tres[j]++; \t\t\tnum \/= j; \t\t\tj = integral_type(2); \t\t} \t\telse { \t\t\t++j; \t\t} \t} \tres[num]++; }  typedef map&lt;ullong, unsigned int&gt; factmap;   \/\/ \u0424\u0443\u043d\u043a\u0446\u0438\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430.  ullong C(int n, int k) {  \tullong result = 1uLL;  \t\/\/ \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b\u044c\u043d\u0430\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0430 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u043a \u0432\u0438\u0434\u0443 \t\/\/ C(n, k) = \u041f(n, k+1) \/ \u041f(1, n-k)  \tint lim_numer_min = k + 1;  \/\/ \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0434\u043b\u044f \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f \tint lim_numer_max = n;      \/\/ \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0434\u043b\u044f \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f \tint lim_denom_min = 2;      \/\/ \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0434\u043b\u044f \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044f \tint lim_denom_max = n - k;  \/\/ \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0438 \u0434\u043b\u044f \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044f  \t\/\/ \u043a\u043e\u043d\u0442\u0435\u0439\u043d\u0435\u0440\u044b \u0434\u043b\u044f \u0440\u0430\u0437\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044f \tfactmap numerator, denominator;  \t\/\/ \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u043e\u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \tfor (int i = lim_numer_min; i &lt;= lim_numer_max; ++i) { \t\tfactorize(ullong(i), numerator); \t} \t\/\/ \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0432\u0441\u0435 \u0441\u043e\u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044f \u043d\u0430 \u043f\u0440\u043e\u0441\u0442\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438 \tfor (int i = lim_denom_min; i &lt;= lim_denom_max; ++i) { \t\tfactorize(ullong(i), denominator); \t}  \t\/\/ \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u043c \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u0435 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f \u043d\u0430 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \tfor (auto i = denominator.begin(); i != denominator.end(); i++) { \t\tnumerator[i-&gt;first] -= i-&gt;second; \t}  \t\/\/ \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u0430 \u043f\u043e \t\/\/ \u043d\u0435\u0441\u043e\u043a\u0440\u0430\u0449\u0451\u043d\u043d\u044b\u043c \u043f\u0440\u043e\u0441\u0442\u044b\u043c \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044f\u043c \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044f \tfor (auto i = numerator.begin(); i != numerator.end(); i++) { \t\t\/\/ \u0432\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u0441\u0442\u0435\u043f\u0435\u043d\u044c \u0432 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430\u0445 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435\u043c \t\tfor (ullong p = 0; p &lt; i-&gt;second; ++p) { \t\t\tresult *= i-&gt;first; \t\t} \t}  \treturn result; } <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/h4>\n<p>  \u0413\u043e\u043b\u043e\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430 \u0431\u044b\u043b\u0430 \u0441\u0434\u0435\u043b\u0430\u043d\u0430 \u043d\u0430\u043f\u043e\u0434\u043e\u0431\u0438\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0438\u0437 <a href=\"http:\/\/habrahabr.ru\/post\/274689\/\">\u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0438<\/a>:<\/p>\n<pre><code class=\"cpp\">int main() { \tint n, k; \tfor (n = 34; n &lt; 68; ++n) { \t\tcout &lt;&lt; &quot;C(&quot; &lt;&lt; n &lt;&lt; &quot;, &quot; &lt;&lt; n\/2 &lt;&lt; &quot;) = &quot; &lt;&lt; C(n, n\/2) &lt;&lt; endl; \t} \treturn 0; } <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:<\/b><\/p>\n<div class=\"spoiler_text\">C(34, 17) = 2333606220<br \/>  C(35, 17) = 4537567650<br \/>  C(36, 18) = 9075135300<br \/>  C(37, 18) = 17672631900<br \/>  C(38, 19) = 35345263800<br \/>  C(39, 19) = 68923264410<br \/>  C(40, 20) = 137846528820<br \/>  C(41, 20) = 269128937220<br \/>  C(42, 21) = 538257874440<br \/>  C(43, 21) = 1052049481860<br \/>  C(44, 22) = 2104098963720<br \/>  C(45, 22) = 4116715363800<br \/>  C(46, 23) = 8233430727600<br \/>  C(47, 23) = 16123801841550<br \/>  C(48, 24) = 32247603683100<br \/>  C(49, 24) = 63205303218876<br \/>  C(50, 25) = 126410606437752<br \/>  C(51, 25) = 247959266474052<br \/>  C(52, 26) = 495918532948104<br \/>  C(53, 26) = 973469712824056<br \/>  C(54, 27) = 1946939425648112<br \/>  C(55, 27) = 3824345300380220<br \/>  C(56, 28) = 7648690600760440<br \/>  C(57, 28) = 15033633249770520<br \/>  C(58, 29) = 30067266499541040<br \/>  C(59, 29) = 59132290782430712<br \/>  C(60, 30) = 118264581564861424<br \/>  C(61, 30) = 232714176627630544<br \/>  C(62, 31) = 465428353255261088<br \/>  C(63, 31) = 916312070471295267<br \/>  C(64, 32) = 1832624140942590534<br \/>  C(65, 32) = 3609714217008132870<br \/>  C(66, 33) = 7219428434016265740<br \/>  C(67, 33) = 14226520737620288370<\/p>\n<p>  Process returned 0 (0x0) execution time: 0.051 s  <\/div>\n<\/div>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"http:\/\/habrahabr.ru\/post\/274911\/\"> http:\/\/habrahabr.ru\/post\/274911\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0420\u0430\u043d\u0435\u0435, \u0432 \u0442\u0440\u0451\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0431\u044b\u043b\u0430 \u0437\u0430\u0442\u0440\u043e\u043d\u0443\u0442\u0430 \u0442\u0435\u043c\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432.<\/p>\n<p>  <a href=\"http:\/\/habrahabr.ru\/post\/274689\/\">\u0420\u0430\u0441\u0447\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u043d\u0430 \u0421\u0438 (\u0421++)<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/274729\/\">\u0420\u0430\u0441\u0447\u0435\u0442 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0424\u0443\u0440\u044c\u0435-\u043f\u0440\u0435\u043e\u0431\u0440\u0430\u0437\u043e\u0432\u0430\u043d\u0438\u0439<\/a><br \/>  <a href=\"http:\/\/habrahabr.ru\/post\/274889\/\">\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432\u2026 \u0432\u0440\u0443\u0447\u043d\u0443\u044e<\/a><\/p>\n<p>  \u0412 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0430\u0432\u0442\u043e\u0440 \u043f\u0440\u043e\u0434\u0435\u043c\u043e\u043d\u0441\u0442\u0440\u0438\u0440\u043e\u0432\u0430\u043b \u0447\u0438\u0441\u0442\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0443\u044e \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0431\u0438\u043d\u043e\u043c\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u0432. \u041e\u043a\u0430\u0437\u0430\u043b\u043e\u0441\u044c, \u0447\u0442\u043e \u0434\u043b\u044f \u0438\u0445 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0438 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440-\u0442\u043e \u043d\u0435 \u043e\u0441\u043e\u0431\u0435\u043d\u043d\u043e \u043d\u0443\u0436\u0435\u043d. \u0425\u0432\u0430\u0442\u0438\u0442 \u0431\u0443\u043c\u0430\u0433\u0438, \u0440\u0443\u0447\u043a\u0438, \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430 <s>\u0438 \u043f\u0438\u0432\u0430<\/s>. \u041e\u0434\u043d\u0430\u043a\u043e, \u0435\u0441\u043b\u0438 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0432\u044b\u0448\u0435\u043f\u0435\u0440\u0435\u0447\u0438\u0441\u043b\u0435\u043d\u043d\u044b\u0445 \u0432\u0435\u0449\u0435\u0439 \u043f\u043e\u0434 \u0440\u0443\u043a\u043e\u0439 \u043d\u0435 \u043e\u043a\u0430\u0436\u0435\u0442\u0441\u044f, \u043d\u043e \u0432 \u043e\u0431\u043b\u0430\u0441\u0442\u0438 \u0434\u043e\u0441\u044f\u0433\u0430\u0435\u043c\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0441\u0442\u0430\u0438\u0432\u0430\u044e\u0449\u0438\u0439 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440, \u0442\u043e \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0442\u043e \u0436\u0435 \u0441\u0430\u043c\u043e\u0435 \u0438 \u043d\u0430 \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0435.  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-271965","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271965","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=271965"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/271965\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=271965"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=271965"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=271965"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}