{"id":155015,"date":"2012-10-17T04:49:35","date_gmt":"2012-10-17T00:49:35","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=155015"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=155015","title":{"rendered":"<span class=\"post_title\">\u0420\u0430\u0437\u0431\u043e\u0440 \u0437\u0430\u0434\u0430\u0447 1 \u0442\u0443\u0440\u0430 \u0448\u043a\u043e\u043b\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 HeadHunter<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u043e\u0448\u0435\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0443\u043d\u0434 \u043e\u0442\u0431\u043e\u0440\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 <a href=\"http:\/\/school.hh.ru\/\">\u0432 \u0448\u043a\u043e\u043b\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 HeadHunter<\/a>, <a href=\"http:\/\/habrahabr.ru\/company\/hh\/blog\/152459\/\">\u0430\u043d\u043e\u043d\u0441 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435<\/a><br \/>  \u0413\u0434\u0435 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0430\u043d\u043a\u0435\u0442\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c 5 \u0437\u0430\u0434\u0430\u0447\u0435\u043a<br \/>  <a name=\"habracut\"><\/a><br \/>  \u0412 \u0430\u043d\u043a\u0435\u0442\u0435 \u043f\u0440\u043e\u0441\u0438\u043b\u0438 \u0437\u0430\u043f\u043e\u043b\u043d\u0438\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043f\u043e\u043b\u044f:  <\/p>\n<ul>\n<li>\u0424\u0418\u041e<\/li>\n<li>\u0434\u0430\u0442\u0443 \u0440\u043e\u0436\u0434\u0435\u043d\u0438\u044f<\/li>\n<li>\u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0443\u044e \u043f\u043e\u0447\u0442\u0443<\/li>\n<li>\u0433\u043e\u0440\u043e\u0434<\/li>\n<li>\u0412\u0423\u0417<\/li>\n<li>\u0444\u0430\u043a\u0443\u043b\u044c\u0442\u0435\u0442<\/li>\n<li>\u0433\u043e\u0434 \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044f<\/li>\n<li>\u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u044c<\/li>\n<li>\u0442\u0435\u043c\u0443 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u043a\u0443\u0440\u0441\u043e\u0432\u043e\u0439 \u0438\u043b\u0438 \u0434\u0438\u043f\u043b\u043e\u043c\u0430<\/li>\n<li>\u043a\u0430\u043a\u0438\u0435 \u0438\u0437 \u043f\u0440\u043e\u0441\u043b\u0443\u0448\u0430\u043d\u043d\u044b\u0445 \u043f\u0440\u0435\u0434\u043c\u0435\u0442\u043e\u0432 \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u0441\u0435\u0433\u043e \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0438\u0441\u044c<\/li>\n<li>\u043c\u0435\u0441\u0442\u043e \u0440\u0430\u0431\u043e\u0442\u044b \u0438 \u0434\u043e\u043b\u0436\u043d\u043e\u0441\u0442\u044c \u0434\u043b\u044f \u0440\u0430\u0431\u043e\u0442\u0430\u044e\u0449\u0438\u0445<\/li>\n<li>\u043d\u0430 \u043a\u0430\u043a\u0438\u0445 \u044f\u0437\u044b\u043a\u0430\u0445 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u0443\u0435\u0442\u0435<\/li>\n<li>\u043e\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u043f\u044b\u0442 \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u043a\u0438<\/li>\n<li>\u0443\u0447\u0430\u0441\u0442\u0438\u0435 \u0432 \u043e\u043b\u0438\u043c\u043f\u0438\u0430\u0434\u0430\u0445 \u0438 \u0441\u0435\u0440\u0442\u0438\u0444\u0438\u043a\u0430\u0442\u044b<\/li>\n<li>\u043f\u043e\u0447\u0435\u043c\u0443 \u0412\u0430\u0441 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u043e\u0432\u0430\u043b\u0430 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0430, \u043e\u0436\u0438\u0434\u0430\u043d\u0438\u044f \u043e\u0442 \u0443\u0447\u0430\u0441\u0442\u0438\u044f<\/li>\n<\/ul>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430 1<\/h4>\n<p>  <\/p>\n<h5>\u0423\u0441\u043b\u043e\u0432\u0438\u0435<\/h5>\n<p>  \u0414\u043b\u044f \u0441\u043a\u043e\u043b\u044c\u043a\u0438 n \u0438 k, \u043f\u0440\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0438 1&lt;=n&lt;132, 1&lt;=k&lt;n \u0447\u0438\u0441\u043b\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439 C(n,k)&gt;1000000?  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0442\u0441\u043a\u0440\u0438\u043d \u0437\u0430\u0434\u0430\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/54f\/5e7\/d2a\/54f5e7d2afb52a82f61c5c12f675f90b.png\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<h5>\u0414\u0443\u043c\u0430\u0435\u043c<\/h5>\n<p>  \u041d\u0430\u0434 \u0447\u0435\u043c \u0442\u0443\u0442 \u0434\u0443\u043c\u0430\u0442\u044c? 132 \u044d\u0442\u043e \u043e\u0447\u0435\u043d\u044c \u043c\u0430\u043b\u043e, \u043f\u043e\u0434\u043e\u0439\u0434\u0435\u0442 \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0431\u043e\u0440, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u0435\u043c \u0435\u0433\u043e \u043d\u0430 \u041f\u0438\u0442\u043e\u043d\u0435.<br \/>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0447\u0438\u0441\u043b\u0430 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0438\u0437 \u043f\u0430\u043a\u0435\u0442\u0430 <a href=\"http:\/\/www.scipy.org\/\">SciPy<\/a> \u2014 \u0432\u043e \u043c\u043d\u043e\u0433\u0438\u0445 \u0441\u043c\u044b\u0441\u043b\u0430\u0445 \u044d\u0442\u043e \u043e\u043f\u0435\u043d-\u0441\u043e\u0440\u0441 Matlab  <\/p>\n<h5>\u0420\u0435\u0448\u0430\u0435\u043c<\/h5>\n<p>  <\/p>\n<pre><code class=\"python\">from scipy.misc import * # \u043e\u0442\u0441\u044e\u0434\u0430 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0447\u0438\u0441\u043b\u043e \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439 total = 0 for n in range(1,133): \tfor k in range(1,n): \t\tif comb(n,k)&gt;1000000: \t\t\ttotal=total+1 print &quot;Answer: &quot;,total <\/code><\/pre>\n<p>  \u0417\u0430\u043f\u0443\u0441\u0442\u0438\u043c, \u0437\u0430\u043c\u0435\u0440\u044f\u044f \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f:  <\/p>\n<pre><code class=\"bash\">#:~\/hh$ time python 1.py  Answer:  7579  real\t0m0.530s user\t0m0.504s sys\t0m0.020s #:~\/hh$  <\/code><\/pre>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430 2:<\/h4>\n<p>  <\/p>\n<h5>\u0423\u0441\u043b\u043e\u0432\u0438\u0435<\/h5>\n<p>  \u0412 \u043c\u0435\u0448\u043a\u0435 \u043d\u0430\u0445\u043e\u0434\u0438\u0442\u0441\u044f 1 \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0438 1 \u0441\u0438\u043d\u0438\u0439 \u0434\u0438\u0441\u043a. \u0412\u043e \u0432\u0440\u0435\u043c\u044f \u0438\u0433\u0440\u044b \u0438\u0433\u0440\u043e\u043a \u0437\u0430 \u0445\u043e\u0434 \u0431\u0435\u0440\u0435\u0442 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0439 \u0434\u0438\u0441\u043a \u0438\u0437 \u043c\u0435\u0448\u043a\u0430, \u0435\u0433\u043e \u0446\u0432\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442. \u041f\u043e\u0441\u043b\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0445\u043e\u0434\u0430 \u0432\u0437\u044f\u0442\u044b\u0439 \u0434\u0438\u0441\u043a \u0432\u043e\u0437\u0432\u0440\u0430\u0449\u0430\u044e\u0442 \u0432 \u043c\u0435\u0448\u043e\u043a \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u044e\u0442 \u0442\u0443\u0434\u0430 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d \u043a\u0440\u0430\u0441\u043d\u044b\u0439 \u0434\u0438\u0441\u043a.<br \/>  \u0418\u0433\u0440\u043e\u043a \u043f\u043b\u0430\u0442\u0438\u0442 1 \u0435\u0432\u0440\u043e \u0437\u0430 \u0438\u0433\u0440\u0443 \u0438 \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442, \u0435\u0441\u043b\u0438 \u0432 \u043a\u043e\u043d\u0446\u0435 \u0438\u0433\u0440\u044b \u043e\u043d \u0434\u043e\u0441\u0442\u0430\u043b \u0431\u043e\u043b\u044c\u0448\u0435 \u0441\u0438\u043d\u0438\u0445 \u0434\u0438\u0441\u043a\u043e\u0432, \u0447\u0435\u043c \u043a\u0440\u0430\u0441\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u0438\u0433\u0440\u0430 \u0434\u043b\u0438\u0442\u0441\u044f 4 \u0445\u043e\u0434\u0430, \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0430 \u0440\u0430\u0432\u043d\u0430 11\/120, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0438\u0437, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0432\u0435\u0434\u0443\u0449\u0438\u0439 \u0438\u0433\u0440\u044b \u043c\u043e\u0436\u0435\u0442 \u043d\u0430\u0437\u043d\u0430\u0447\u0438\u0442\u044c \u0437\u0430 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u044d\u0442\u043e\u0439 \u0438\u0433\u0440\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 10 \u0435\u0432\u0440\u043e, \u0438\u043d\u0430\u0447\u0435 \u043e\u043d \u043d\u0430\u0447\u043d\u0435\u0442 \u043d\u0435\u0441\u0442\u0438 \u0443\u0431\u044b\u0442\u043a\u0438. <br \/>  \u041e\u0431\u0440\u0430\u0442\u0438\u0442\u0435 \u0432\u043d\u0438\u043c\u0430\u043d\u0438\u0435, \u0447\u0442\u043e \u044d\u0442\u043e \u0446\u0435\u043b\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u0438 \u043e\u043d\u043e \u0432\u043a\u043b\u044e\u0447\u0430\u0435\u0442 \u0432 \u0441\u0435\u0431\u044f \u043f\u0435\u0440\u0432\u043e\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u0443\u044e \u043e\u043f\u043b\u0430\u0442\u0443 \u0443\u0447\u0430\u0441\u0442\u0438\u044f, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0438\u0433\u0440\u043e\u043a \u0440\u0435\u0430\u043b\u044c\u043d\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 9 \u0435\u0432\u0440\u043e.<br \/>  \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0443\u044e \u0446\u0435\u043b\u0443\u044e \u0441\u0443\u043c\u043c\u0443 \u043f\u0440\u0438\u0437\u0430, \u043d\u0435 \u0434\u0435\u043b\u0430\u044e\u0449\u0443\u044e \u0438\u0433\u0440\u0443 \u043d\u0435\u0432\u044b\u0433\u043e\u0434\u043d\u043e\u0439 \u0432\u0435\u0434\u0443\u0449\u0435\u043c\u0443 \u0432 \u0438\u0433\u0440\u0435 \u0438\u0437 30 \u0445\u043e\u0434\u043e\u0432?  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0422\u043e \u0436\u0435 \u0437\u0430\u0434\u0430\u043d\u0438\u0435 \u043f\u0440\u0438\u043d\u0442\u0441\u043a\u0440\u0438\u043d\u043e\u043c<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/2b4\/96c\/e5c\/2b496ce5c529513aa9b27e3ac0db16c5.png\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<h5>\u041f\u043e\u043d\u0438\u043c\u0430\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u0438\u0435<\/h5>\n<p>  \u0412 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u0435 \u0438\u0433\u0440\u044b \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u0440\u0430\u0441\u043d\u044b\u0445 \u0448\u0430\u0440\u043e\u0432 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u0437\u043d\u0430\u0447\u0438\u0442 \u043f\u0430\u0434\u0430\u0435\u0442 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0435\u0434\u0438\u043d\u0441\u0442\u0432\u0435\u043d\u043d\u044b\u0439 \u0441\u0438\u043d\u0438\u0439. \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0438\u0433\u0440\u0430\u0442\u044c, \u043d\u0443\u0436\u043d\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u0441\u0438\u043d\u0438\u0445. \u0417\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0437 \u0443\u0433\u0430\u0434\u0430\u0442\u044c \u0441\u0438\u043d\u0438\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c 1\/2 \u0437\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0440\u0430\u0437 1\/3, \u0437\u0430 n-\u043d\u044b\u0439 \u0440\u0430\u0437 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u0441\u0442\u0430\u0442\u044c \u0441\u0438\u043d\u0438\u0439 \u0440\u0430\u0432\u043d\u0430 1\/(n+1).  <\/p>\n<h5>\u0420\u0430\u0437\u0431\u0438\u0440\u0430\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u0438\u0437 \u0443\u0441\u043b\u043e\u0432\u0438\u044f<\/h5>\n<p>  \u0415\u0441\u043b\u0438 \u0434\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0438\u0433\u0440\u044b \u0440\u0430\u0432\u043d\u0430 4 \u0445\u043e\u0434\u0430\u043c, \u043f\u043e\u043b\u0443\u0447\u0430\u044e\u0442\u0441\u044f \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 1\/2, 1\/3, 1\/4, 1\/5. \u0427\u0442\u043e\u0431\u044b \u0432\u044b\u0438\u0433\u0440\u0430\u0442\u044c, \u043c\u043e\u0436\u043d\u043e \u043e\u0448\u0438\u0431\u0438\u0442\u044c\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e 1 \u0440\u0430\u0437. \u041f\u0440\u0438\u0447\u0435\u043c \u0432 \u043a\u0430\u043a\u043e\u0439 \u0438\u0437 \u043f\u043e\u043f\u044b\u0442\u043e\u043a \u043c\u044b \u043e\u0448\u0438\u0431\u043b\u0438\u0441\u044c \u043d\u0435\u0432\u0430\u0436\u043d\u043e. \u041f\u043e\u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u043a\u0430\u043a\u043e\u0432\u0430 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u044c \u0443\u0441\u043f\u0435\u0445\u0430: 1\/60+1\/40+1\/30+1\/24+1\/120=15\/120  <\/p>\n<h5>\u0414\u0443\u043c\u0430\u0435\u043c<\/h5>\n<p>  \u0424\u0430\u043a\u0442\u043e\u0440\u0438\u0430\u043b 30 \u0447\u0438\u0441\u043b\u043e \u043c\u0430\u043b\u0435\u043d\u044c\u043a\u043e\u0435, \u043e\u043f\u044f\u0442\u044c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0431\u043e\u0440. \u0413\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0447\u0438\u0441\u043b\u0430 \u0441\u043e\u0447\u0435\u0442\u0430\u043d\u0438\u0439 \u0432\u043e\u0437\u044c\u043c\u0435\u043c \u0438\u0437 \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0432 \u043f\u0438\u0442\u043e\u043d \u043f\u0430\u043a\u0435\u0442\u0430 <a href=\"http:\/\/docs.python.org\/library\/itertools.html\">itertools<\/a>  <\/p>\n<h5>\u0420\u0435\u0448\u0430\u0435\u043c<\/h5>\n<p>  <\/p>\n<pre><code class=\"python\">import itertools game=30 comb=[] resb=1 for t in range(2,game+2):         comb.append(t)         resb=resb*t # \u0441\u0447\u0438\u0442\u0430\u0435\u043c \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0434\u0440\u043e\u0431\u0438 print comb resa=0 for q in range(game\/2+1,game+1): # \u0432\u044b\u0442\u0430\u0449\u0438\u0442\u044c \u043d\u0443\u0436\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b \u0441\u0438\u043d\u0438\u0445         print q,resa,resb # \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0435 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b         for t in itertools.combinations(comb,q): # \u043f\u0435\u0440\u0435\u0431\u0438\u0440\u0430\u0435\u043c \u0432\u0441\u0435 \u043a\u043e\u043c\u0431\u0438\u043d\u0430\u0446\u0438\u0438                 ca=1                 cb=1                           for x in t:                         cb=cb*x                 tdiv=resb\/cb                 resa=resa+tdiv*ca           print game\/2+1 print resa,resb # \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c \u0438 \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u0434\u0440\u043e\u0431\u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0432\u0435\u0440\u043e\u044f\u0442\u043d\u043e\u0441\u0442\u0438 \u0432\u044b\u0438\u0433\u0440\u0430\u0442\u044c <\/code><\/pre>\n<pre><code class=\"bash\">#:~\/hh\/article$ time python 2.p [2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31] 16 0 8222838654177922817725562880000000 17 6014558687904548121004575 8222838654177922817725562880000000 18 6363613319405364461146200 8222838654177922817725562880000000 19 6381128687025974988156255 8222838654177922817725562880000000 20 6381886877953385972148180 8222838654177922817725562880000000 21 6381915085555093961253855 8222838654177922817725562880000000 22 6381915982709887260743580 8222838654177922817725562880000000 23 6381916006925362413306495 8222838654177922817725562880000000 24 6381916007474554489499970 8222838654177922817725562880000000 25 6381916007484879987901695 8222838654177922817725562880000000 26 6381916007485037971122090 8222838654177922817725562880000000 27 6381916007485039887292479 8222838654177922817725562880000000 28 6381916007485039905011334 8222838654177922817725562880000000 29 6381916007485039905128639 8222838654177922817725562880000000 30 6381916007485039905129134 8222838654177922817725562880000000 16 6381916007485039905129135 8222838654177922817725562880000000  real\t23m2.424s user\t23m0.238s sys\t0m0.168s #:~\/hh\/article$ <\/code><\/pre>\n<p>  \u041f\u043e\u043a\u0430 \u0441\u0447\u0438\u0442\u0430\u0435\u0442 23 \u043c\u0438\u043d\u0443\u0442\u044b \u0440\u0435\u0448\u0430\u0435\u043c \u0434\u0440\u0443\u0433\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438.<br \/>  \u0434\u0440\u043e\u0431\u044c \u043d\u0443\u0436\u043d\u043e \u043f\u0435\u0440\u0435\u0432\u0435\u0441\u0442\u0438 \u0432 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u2014 \u0434\u0435\u043b\u0438\u043c \u0437\u043d\u0430\u043c\u0435\u043d\u0430\u0442\u0435\u043b\u044c \u043d\u0430 \u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0440\u0430\u0437\u043c\u0435\u0440 \u0432\u044b\u0438\u0433\u0440\u044b\u0448\u0430 \u00ab\u0441\u0430\u043c\u043e\u043e\u043a\u0443\u043f\u0430\u0435\u043c\u043e\u0441\u0442\u0438\u00bb.  <\/p>\n<pre><code class=\"bash\">#:~\/hh\/article$ bc -l bc 1.06.95 Copyright 1991-1994, 1997, 1998, 2000, 2004, 2006 Free Software Foundation, Inc. This is free software with ABSOLUTELY NO WARRANTY. For details type `warranty'.  8222838654177922817725562880000000\/6381916007485039905129135 1288459240.85082818135254719839 ^C (interrupt) use quit to exit. #:~\/hh\/article$  <\/code><\/pre>\n<p>  \u041d\u0430\u043c \u043d\u0443\u0436\u0435\u043d \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u043f\u0440\u0435\u0434\u0443\u0434\u044b\u0449\u0438\u0439, \u0432 \u043e\u0442\u0432\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0446\u0435\u043b\u0443\u044e \u0447\u0430\u0441\u0442\u044c, \u0442.\u0435. 1288459240  <\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430 3:<\/h4>\n<p>  \u0415\u0441\u043b\u0438 \u0432 \u0447\u0438\u0441\u043b\u0435 \u0432\u0441\u0435 \u0446\u0438\u0444\u0440\u044b \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0441\u043b\u0435\u0432\u0430 \u043e\u0442 \u043d\u0438\u0445, \u043e\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u043c\u0441\u044f. \u041f\u0440\u0438\u043c\u0435\u0440 \u2014 133456. \u0421\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u0435\u0441\u043b\u0438 \u0447\u0438\u0441\u043b\u0430 \u043d\u0435 \u043c\u0435\u043d\u044c\u0448\u0435 \u0441\u0442\u043e\u044f\u0449\u0438\u0445 \u0441\u043f\u0440\u0430\u0432\u0430, \u043e\u043d\u043e \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0443\u0431\u044b\u0432\u0430\u044e\u0449\u0438\u043c. \u041f\u0440\u0438\u043c\u0435\u0440: 66420.<br \/>  \u0427\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043d\u0438 \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u044e\u0449\u0438\u043c\u0438, \u043d\u0438 \u0443\u0431\u044b\u0432\u0430\u044e\u0449\u0438\u043c\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u043f\u0440\u044b\u0433\u0430\u044e\u0449\u0438\u043c\u0438.<br \/>  \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u0435\u0442 \u043f\u044b\u0440\u0433\u0430\u044e\u0449\u0438\u0445 \u0447\u0438\u0441\u0435\u043b, \u043c\u0435\u043d\u044c\u0448\u0435 10^75?  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u0440\u0438\u043d\u0442\u0441\u043a\u0440\u0438\u043d \u0437\u0430\u0434\u0430\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/a7b\/661\/af9\/a7b661af91aba5f0aa5c83062a69a757.png\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<h5>\u0414\u0443\u043c\u0430\u0435\u043c:<\/h5>\n<p>  \u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0435\u0440\u0435\u0431\u043e\u0440 \u0434\u043e\u043b\u0433\u043e, \u0430 \u0438\u043d\u0434\u0443\u043a\u0446\u0438\u044f \u043f\u0440\u0438\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043e\u0442\u043b\u0438\u0447\u043d\u043e (\u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435)<br \/>  \u0414\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0435\u043c\u0443\u0441\u044f \u0447\u0438\u0441\u043b\u0443 \u0441\u043b\u0435\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442 1 \u0434\u043e \u043f\u0435\u0440\u0432\u043e\u0439 \u0446\u0438\u0444\u0440\u044b \u0447\u0438\u0441\u043b\u0430 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u0430 \u043a \u043b\u044e\u0431\u043e\u043c\u0443 \u0443\u0431\u044b\u0432\u0430\u044e\u0449\u0435\u043c\u0443 \u0441\u043f\u0440\u0430\u0432\u0430 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u043f\u0438\u0441\u0430\u0442\u044c \u043e\u0442 \u043d\u0443\u043b\u044f \u0434\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0446\u0438\u0444\u0440\u044b \u0447\u0438\u0441\u043b\u0430 \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e.  <\/p>\n<h5>\u0420\u0435\u0448\u0430\u0435\u043c:<\/h5>\n<pre><code class=\"python\"># \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0441\u043b\u043e\u0432\u0430\u0440\u0438 \u0438\u043d\u0434\u0443\u043a\u0446\u0438\u0438 a={} # \u0445\u0440\u0430\u043d\u0438\u043c \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u044e\u0449\u0438\u0435\u0441\u044f b={} # \u0434\u043b\u044f \u0443\u0431\u044b\u0432\u0430\u044e\u0449\u0438\u0445 for t in range(0,11): \ta[1,t]=1 # \u041f\u0435\u0440\u0432\u044b\u0439 \u043a\u043b\u044e\u0447 - \u0434\u043b\u0438\u043d\u0430 \u0447\u0438\u0441\u043b\u0430, \u0432\u0442\u043e\u0440\u043e\u0439 \u043a\u043b\u044e\u0447 - \u043b\u0435\u0432\u0430\u044f(\u043f\u0440\u0430\u0432\u0430\u044f) \u0446\u0438\u0444\u0440\u0430. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 - \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0442\u0430\u043a\u0438\u0445 \u0447\u0438\u0441\u0435\u043b \tb[1,t]=1 def snext(tail): \tglobal a,b \ttvar=0 \tbtvar=0 \tfor d in range(0,11): # \u043e\u0431\u044a\u044f\u0432\u043b\u044f\u0435\u043c \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u043d\u043e\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \t\ta[tail,d]=0 \t\tb[tail,d]=0         for d in range(1,10): # \u043f\u0440\u0438\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043b\u0435\u0432\u0430 \u0446\u0438\u0444\u0440\u044b \t\tvar=0 \t\tbvar=0 \t\tt=a[tail-1,d] \t\ttb=b[tail-1,d] \t\tfor q in range(1,d+1): \t\t\tvar=var+t \t\t\ta[tail,q]=a[tail,q]+t#var \t\ttvar=tvar+var \tfor d in range(0,10): # \u043f\u0440\u0438\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u043f\u0440\u0430\u0432\u0430 \u0446\u0438\u0444\u0440\u044b \t\tbvar=0 \t\ttb=b[tail-1,d]                 for q in range(d,10):                         bvar=bvar+tb                         b[tail,q]=b[tail,q]+tb \t\tbtvar=btvar+bvar\t \tbtvar=btvar-1 \tprint tail,tvar,btvar \treturn [tvar,btvar]\t start=0 for q in range(2,76): \t[pa,pb]=snext(q) \tstart=start-pa-pb-9 # \u0442.\u043a. \u0447\u0438\u0441\u043b\u0430 \u0441\u043e\u0441\u0442\u0430\u044f\u0449\u0438\u0435 \u0438\u0437 \u043e\u0434\u043d\u0438\u0445 \u0435\u0434\u0438\u043d\u0438\u0446, \u0434\u0432\u043e\u0435\u043a, ...., \u0434\u0435\u0432\u044f\u0442\u043e\u043a \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0434\u0432\u0430\u0436\u0434\u044b - \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0438\u0435 9 start=start-10 # \u0432\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u043b\u0438\u0448\u043d\u0438\u0435 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 print &quot;10^75&quot;, start <\/code><\/pre>\n<p>  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0414\u043b\u0438\u043d\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"bash\">#:~\/hh\/article$ time python 3.py  2 45 54 3 165 219 4 495 714 5 1287 2001 6 3003 5004 7 6435 11439 8 12870 24309 9 24310 48619 10 43758 92377 11 75582 167959 12 125970 293929 13 203490 497419 14 319770 817189 15 490314 1307503 16 735471 2042974 17 1081575 3124549 18 1562275 4686824 19 2220075 6906899 20 3108105 10015004 21 4292145 14307149 22 5852925 20160074 23 7888725 28048799 24 10518300 38567099 25 13884156 52451255 26 18156204 70607459 27 23535820 94143279 28 30260340 124403619 29 38608020 163011639 30 48903492 211915131 31 61523748 273438879 32 76904685 350343564 33 95548245 445891809 34 118030185 563921994 35 145008513 708930507 36 177232627 886163134 37 215553195 1101716329 38 260932815 1362649144 39 314457495 1677106639 40 377348994 2054455633 41 450978066 2505433699 42 536878650 3042312349 43 636763050 3679075399 44 752538150 4431613549 45 886322710 5317936259 46 1040465790 6358402049 47 1217566350 7575968399 48 1420494075 8996462474 49 1652411475 10648873949 50 1916797311 12565671260 51 2217471399 14783142659 52 2558620845 17341763504 53 2944827765 20286591269 54 3381098545 23667689814 55 3872894697 27540584511 56 4426165368 31966749879 57 5047381560 37014131439 58 5743572120 42757703559 59 6522361560 49280065119 60 7392009768 56672074887 61 8361453672 65033528559 62 9440350920 74473879479 63 10639125640 85113005119 64 11969016345 97082021464 65 13442126049 110524147513 66 15071474661 125595622174 67 16871053725 142466675899 68 18855883575 161322559474 69 21042072975 182364632449 70 23446881315 205811513764 71 26088783435 231900297199 72 28987537150 260887834349 73 32164253550 293052087899 74 35641470150 328693558049 75 39443226966 368136785015 10^75 -3497299458233  real\t0m0.070s user\t0m0.044s sys\t0m0.020s #:~\/hh\/article$  <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430 4:<\/h4>\n<p>  \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u043d\u043e\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u0447\u043b\u0435\u043d\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0424\u0438\u0431\u0431\u043e\u043d\u0430\u0447\u0438, \u0447\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0446\u0438\u0444\u0440 \u0432 \u043d\u0435\u043c \u0440\u0430\u0432\u043d\u043e 1369  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0442\u0441\u043a\u0440\u0438\u043d \u0437\u0430\u0434\u0430\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/69d\/8d6\/d60\/69d8d6d600ef5232ee4118c25053a9c1.png\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<h5>\u0414\u0443\u043c\u0430\u0435\u043c:<\/h5>\n<p>  \u0411\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u0424\u0438\u0431\u0431\u043e\u043d\u0430\u0447\u0438, \u043f\u0435\u0440\u0435\u0432\u043e\u0434\u0438\u0442\u044c \u0432 \u0441\u0442\u0440\u043e\u043a\u043e\u0432\u043e\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u043d\u0430 \u0434\u043b\u0438\u043d\u0443.  <\/p>\n<h5>\u0420\u0435\u0448\u0430\u0435\u043c:<\/h5>\n<p>  <\/p>\n<pre><code class=\"python\">mlen=1369 a1=1 a2=1 ct=2 while len(str(a1+a2))&lt;mlen: \ta3=a1+a2 \ta1=a2 \ta2=a3 \tct=ct+1 ct=ct+1 print a3,len(str(a3)),ct <\/code><\/pre>\n<p>  <\/p>\n<pre><code class=\"bash\">#:~\/hh$ time python 4.py 780900524347766560369409601397283583731565781613263766310753171005772816606447127796238704640229315255837674837377848165134157698160368949544530968794502543368882016531029514678028439260706408177729197487662072465572674876642154084378757480925617839826591149409430192878644658489021494500819466317586441937981822347486163565795152808072012368235080216554272512192800729666417669829763531411213108494418913118518602993302492226514346776633151914463050060224509695982703686755416142840706010623006936874524452187722869551681108749361294810695099504076646550576016809634068421557376832617580999236289371413151899566524614973575753248715742472176747459972608155732634727630330527033718278452846765174770728172912921167441008174546335351766020470707921356776862494695433732667044761786181261729619777198918422157071750747357444434612359278543575242617905368425489288524399123583290845306893000730480723867599367964989977241039149647013546967023147867695604450552374936008874557855435456223434642380936719467687026632615769316496835506366896848050379321482973448206502401722698140500374496142639625192381119796460488752404250147189479846363428957348179528030884277109256778540767915891043086029025915629061548978311433769206291930634863662192108026152395440631585079728836245987908191549472234398723916120832401441793104897541209034633661071095358336193091746252749026143573 1368 6548  real\t0m0.183s user\t0m0.164s sys\t0m0.012s #:~\/hh$  <\/code><\/pre>\n<p>  <\/p>\n<h4>\u0417\u0430\u0434\u0430\u0447\u0430 5:<\/h4>\n<p>  \u041d\u0430\u0439\u0434\u0438\u0442\u0435 10 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0445 \u0446\u0438\u0444\u0440 \u0432 \u043a\u043e\u043d\u0435\u0447\u043d\u043e\u0439 \u0441\u0443\u043c\u043c\u0435 \u0440\u044f\u0434\u0430, 1^1+2^2+3^3+&#8230;+1145^1145  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u041f\u043e\u043b\u043d\u044b\u0439 \u043f\u0440\u0438\u043d\u0442\u0441\u043a\u0440\u0438\u043d \u0437\u0430\u0434\u0430\u043d\u0438\u044f<\/b><\/p>\n<div class=\"spoiler_text\"><img decoding=\"async\" src=\"http:\/\/habrastorage.org\/storage2\/36f\/1aa\/777\/36f1aa777c8df853d85018636921af39.png\"\/>  <\/div>\n<\/div>\n<p>  <\/p>\n<h5>\u0414\u0443\u043c\u0430\u0435\u043c:<\/h5>\n<p>  \u0427\u0438\u0441\u043b\u043e 1145 \u0432 1145 \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u043e\u0435. \u0412 \u0437\u0430\u0434\u0430\u043d\u0438\u0438 \u043f\u0440\u043e\u0441\u044f\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0438 10 \u0446\u0438\u0444\u0440, \u0437\u043d\u0430\u0447\u0438\u0442 \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430\u043c\u0438 \u043c\u043e\u0434\u0443\u043b\u044c\u043d\u043e\u0439 \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u043a\u0438 \u2014 \u0441\u0440\u0430\u0437\u0443 \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0432\u0441\u0435 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e.  <\/p>\n<h5>\u0420\u0435\u0448\u0430\u0435\u043c:<\/h5>\n<p>  \u0414\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0441\u0442\u0435\u043f\u0435\u043d\u0438 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u0432\u043e\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u0441\u044f \u043f\u0430\u043a\u0435\u0442\u043e\u043c <a href=\"http:\/\/userpages.umbc.edu\/~rcampbel\/Computers\/Python\/numbthy.html\">http:\/\/userpages.umbc.edu\/~rcampbel\/Computers\/Python\/numbthy.html<\/a><br \/>  \u041a\u0430\u0447\u0430\u0435\u043c <a href=\"http:\/\/userpages.umbc.edu\/~rcampbel\/Computers\/Python\/lib\/numbthy.py\">http:\/\/userpages.umbc.edu\/~rcampbel\/Computers\/Python\/lib\/numbthy.py<\/a> \u0438 \u043a\u043b\u0430\u0434\u0435\u043c \u0432 \u043f\u0430\u043f\u043a\u0443 \u0441 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u043e\u0439:  <\/p>\n<pre><code class=\"python\">import numbthy as np t=0 for i in range(1,1146): \tt=t+np.powmod(i,i,1000000000000000000000) print t % 10000000000 <\/code><\/pre>\n<pre><code class=\"bash\">#:~\/hh$ time python 5.py 7110603381  real\t0m0.029s user\t0m0.020s sys\t0m0.004s #:~\/hh$   <\/code><\/pre>\n<p>  \u0413\u043e\u0432\u043e\u0440\u044f\u0442, \u0447\u0442\u043e \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e \u0440\u0435\u0448\u0435\u043d\u044b 2 \u0437\u0430\u0434\u0430\u0447\u0438 \u0438\u0437 5. \u041e\u0434\u043d\u0443 \u043e\u0448\u0438\u0431\u043a\u0443 \u0437\u043d\u0430\u044e, \u0430 \u0433\u0434\u0435 \u0434\u0440\u0443\u0433\u0438\u0435?    \t   \t<\/p>\n<div class=\"clear\"><\/div>\n<\/p><\/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\/155015\/\"> http:\/\/habrahabr.ru\/post\/155015\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u041f\u0440\u043e\u0448\u0435\u043b \u043f\u0435\u0440\u0432\u044b\u0439 \u0440\u0430\u0443\u043d\u0434 \u043e\u0442\u0431\u043e\u0440\u0430 \u0443\u0447\u0430\u0441\u0442\u043d\u0438\u043a\u043e\u0432 <a href=\"http:\/\/school.hh.ru\/\">\u0432 \u0448\u043a\u043e\u043b\u0443 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0441\u0442\u043e\u0432 HeadHunter<\/a>, <a href=\"http:\/\/habrahabr.ru\/company\/hh\/blog\/152459\/\">\u0430\u043d\u043e\u043d\u0441 \u043d\u0430 \u0445\u0430\u0431\u0440\u0435<\/a><br \/>  \u0413\u0434\u0435 \u043f\u043e\u0441\u043b\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u0430\u043d\u043a\u0435\u0442\u044b \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u043b\u043e\u0441\u044c \u0440\u0435\u0448\u0438\u0442\u044c 5 \u0437\u0430\u0434\u0430\u0447\u0435\u043a  <\/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-155015","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/155015","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=155015"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/155015\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=155015"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=155015"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=155015"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}