{"id":208088,"date":"2014-01-09T13:10:02","date_gmt":"2014-01-09T09:10:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=208088"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=208088","title":{"rendered":"<span class=\"post_title\">\u0421\u043e\u043b\u043e\u043c\u043e\u043d\u043e\u0432\u0430 \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430<\/span>"},"content":{"rendered":"<div class=\"content html_format\">   \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u041d\u043e\u0432\u043e\u0433\u043e \u0413\u043e\u0434\u0430!<\/p>\n<p>  \u0412 \u043a\u043e\u043f\u0438\u043b\u043a\u0443 \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0443 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439, \u043d\u043e \u043e\u0431\u0435\u0449\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041f\u0443\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 <b>N<\/b> \u0438\u0437 <b>n<\/b> \u0446\u0435\u043b\u044b\u0445 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043e\u0442 <b>1<\/b> \u0434\u043e <b>n<\/b>. <br \/>  \u0421\u0430\u043c\u043e\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f <b>n<\/b> \u0447\u0438\u0441\u0435\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c <b>n<\/b> \u044f\u0447\u0435\u0435\u043a. \u0412\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0447\u0438\u0441\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432  <\/p>\n<table>\n<tr>\n<td>3<\/td>\n<td>5<\/td>\n<td> 2<\/td>\n<td>1<\/td>\n<td>8<\/td>\n<td>4<\/td>\n<td>7<\/td>\n<td>6<\/td>\n<td>9<\/td>\n<td>10<\/td>\n<\/tr>\n<\/table>\n<p>  \u041d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 <b>N<\/b> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u043c (\u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e, \u0438\u043b\u0438 \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e), \u0437\u0430\u043f\u0438\u0441\u0430\u0432 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0433\u043e. <\/p>\n<p>  \u0423\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432  <\/p>\n<table>\n<tr>\n<td>1<\/td>\n<td>2<\/td>\n<td>3<\/td>\n<td>4<\/td>\n<td>5<\/td>\n<td>6<\/td>\n<td>7<\/td>\n<td>8<\/td>\n<td>9<\/td>\n<td>10<\/td>\n<\/tr>\n<\/table>\n<p>  <a name=\"habracut\"><\/a><br \/>  \u0422\u0430\u043a\u0438\u043c \u0436\u0435 \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043c\u043e\u0436\u043d\u043e \u00ab\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c\u00bb \u043d\u0430\u0431\u043e\u0440\u044b \u0447\u0438\u0441\u0435\u043b (\u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0438\u043c\u0441\u044f \u0446\u0435\u043b\u044b\u043c\u0438 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438), \u0443\u0434\u043e\u0432\u043b\u0435\u0442\u0432\u043e\u0440\u044f\u044e\u0449\u0438\u0435 \u0443\u0441\u043b\u043e\u0432\u0438\u044e <b>n<sub>max<\/sub>-n<sub>min<\/sub> = n<\/b>.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0431\u043e\u043b\u0435\u0435 \u0441\u043b\u043e\u0436\u043d\u044b\u0439 \u0441\u043b\u0443\u0447\u0430\u0439.<\/p>\n<p>  \u041f\u0443\u0441\u0442\u044c \u043d\u0430\u0431\u043e\u0440 <b>N<\/b> (\u043e\u043f\u044f\u0442\u044c \u0436\u0435 \u0446\u0435\u043b\u044b\u0445 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b) \u0442\u0430\u043a\u043e\u0432, \u0447\u0442\u043e <b>n<sub>max<\/sub>-n<sub>min<\/sub> &gt; n<\/b>, \u0438 \u0432\u0441\u0435 \u0447\u0438\u0441\u043b\u0430<b> n(i)<\/b> \u0432 \u043d\u0430\u0431\u043e\u0440\u0435 \u0440\u0430\u0437\u043d\u044b\u0435.  <\/p>\n<table>\n<tr>\n<td>30<\/td>\n<td>55<\/td>\n<td> 21<\/td>\n<td>17<\/td>\n<td>82<\/td>\n<td>46<\/td>\n<td>79<\/td>\n<td>63<\/td>\n<td>94<\/td>\n<td>108<\/td>\n<\/tr>\n<\/table>\n<p>  \u0427\u0442\u043e\u0431\u044b \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440, \u043d\u0443\u0436\u043d\u043e:<br \/>  1) \u043d\u0430\u0439\u0442\u0438 <b>n<sub>max<\/sub><\/b>, <b>n<sub>min<\/sub><\/b> <br \/>  2) \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0434\u0435\u043b\u044c\u0442\u0430 <b>d=(n<sub>max<\/sub>-n<sub>min<\/sub>) \/n<\/b><br \/>  3) \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e <b> n(i)<\/b> (\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u043f\u0440\u043e\u0446\u0435\u0434\u0443\u0440\u0443 \u043d\u0430\u0437\u043e\u0432\u0435\u043c \u0443\u0441\u043b\u043e\u0432\u043d\u043e \u00ab\u0440\u0430\u0437\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u043a\u0430\u043c\u043d\u0435\u0439\u00bb):<br \/>  3\u0430) \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0438\u043d\u0434\u0435\u043a\u0441 <b>indx=( n(i)-n<sub>min<\/sub>)\/d+1<\/b>(\u0442\u0430\u043a \u043a\u0430\u043a \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u044e\u0442\u0441\u044f \u0432 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430\u0445, \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u043b\u044f \u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0430\u0446\u0438\u0438 \u043e\u043a\u0440\u0443\u0433\u043b\u0435\u043d\u0438\u044f \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0435\u043d\u0438\u044f \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0430)<\/p>\n<p>  \u0427\u0438\u0441\u043b\u0430 <b> n(i)<\/b> \u0438 \u0438\u043d\u0434\u0435\u043a\u0441\u044b <b>indx<\/b> \u0430\u043a\u0430 \u043c\u0435\u0441\u0442\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0434\u043e\u043b\u0436\u043d\u044b \u0441\u0442\u043e\u044f\u0442\u044c \u044d\u0442\u0438 \u0447\u0438\u0441\u043b\u0430.  <\/p>\n<table>\n<tr>\n<td>30<\/td>\n<td>55<\/td>\n<td> 21<\/td>\n<td>17<\/td>\n<td>82<\/td>\n<td>46<\/td>\n<td>79<\/td>\n<td>63<\/td>\n<td>94<\/td>\n<td>108<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>5<\/td>\n<td> 1<\/td>\n<td>1<\/td>\n<td>7<\/td>\n<td>4<\/td>\n<td>7<\/td>\n<td>5<\/td>\n<td>9<\/td>\n<td>10<\/td>\n<\/tr>\n<\/table>\n<p>  3\u0431) \u0432 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u043e\u0434\u0433\u043e\u0442\u043e\u0432\u043b\u0435\u043d\u043d\u043e\u043c, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u043e\u043c \u043d\u0443\u043b\u044f\u043c\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 \u00ab\u0438\u043d\u0434\u0435\u043a\u0441\u044b\u00bb <b>Indxs<\/b> \u0438\u043d\u043a\u0440\u0435\u043c\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c \u044f\u0447\u0435\u0439\u043a\u0443 \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0432 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0435\u043c \u0448\u0430\u0433\u0435  <\/p>\n<table>\n<tr>\n<td>2<\/td>\n<td>1<\/td>\n<td> 0<\/td>\n<td>1<\/td>\n<td>2<\/td>\n<td>0<\/td>\n<td>2<\/td>\n<td>0<\/td>\n<td>1<\/td>\n<td>1<\/td>\n<\/tr>\n<\/table>\n<p>  3\u0432) \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u043e\u043b\u0443\u0447\u0438\u0432\u0448\u0435\u0435\u0441\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435<br \/>  3\u0433) \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u0435\u0433\u043e \u043d\u0430 <b>n<\/b> \u0438 \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u043c \u0441 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u043c, \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043f\u043e \u044d\u0442\u043e\u043c\u0443 \u0430\u0434\u0440\u0435\u0441\u0443 \u0447\u0438\u0441\u043b\u043e<b> n(i)<\/b> \u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0435 <b> N<sub>new<\/sub><\/b><br \/>  \u0415\u0441\u043b\u0438 \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0442\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b, <b> n(i)<\/b> \u0432 \u043c\u0430\u0441\u0441\u0438\u0432<b> N<sub> new<\/sub><\/b> \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u043d\u0435 \u0440\u044f\u0434\u043e\u043c, \u0430 \u0441\u043d\u0438\u0437\u0443.  <\/p>\n<table>\n<tr>\n<td>21<\/td>\n<td>30<\/td>\n<td> <\/td>\n<td>46<\/td>\n<td>55<\/td>\n<td> <\/td>\n<td>82<\/td>\n<td> <\/td>\n<td>94<\/td>\n<td>108<\/td>\n<\/tr>\n<tr>\n<td>17<\/td>\n<td> <\/td>\n<td><\/td>\n<td><\/td>\n<td>63<\/td>\n<td><\/td>\n<td>79<\/td>\n<td><\/td>\n<td><\/td>\n<\/tr>\n<\/table>\n<p>  4) \u0434\u0430\u043b\u0435\u0435 \u043f\u0440\u0438\u0441\u0442\u0443\u043f\u0430\u0435\u043c \u043a \u00ab\u0441\u0431\u043e\u0440\u0443 \u043a\u0430\u043c\u043d\u0435\u0439\u00bb <br \/>  \u041a\u043b\u0430\u0434\u0435\u043c <b>i=1<\/b> \u0438 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u043d\u0434\u0435\u043a\u0441\u043e\u0432 <b>Indxs<\/b> \u043f\u043e\u043a\u0430 <b>i \u2264 n<\/b><br \/>  4\u0430) \u0435\u0441\u043b\u0438 <b>Indxs(i)<\/b> = 0, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 <b>i<\/b><br \/>  4\u0431) \u0435\u0441\u043b\u0438 <b>Indxs(i)<\/b> = 1, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0447\u0438\u0441\u043b\u043e \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <b> N<sub>new<\/sub><\/b>, \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u0432 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 <b>i<\/b><br \/>  4\u0432) \u0435\u0441\u043b\u0438 <b>Indxs(i)<\/b> = 2, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0447\u0438\u0441\u043b\u0430 \u0438\u0437 <b> N<sub>new<\/sub><\/b> \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u00ab\u043f\u043e-\u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u0438\u00bb, \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0438\u0445 \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0441\u043f\u0435\u0440\u0432\u0430 \u043c\u0435\u043d\u044c\u0448\u0435\u0435, \u0437\u0430\u0442\u0435\u043c \u0431\u043e\u043b\u044c\u0448\u0435\u0435, \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 <b>i<\/b><br \/>  4\u0433) \u0435\u0441\u043b\u0438 <b>Indxs(i)<\/b> = 3, \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c 3 \u0447\u0438\u0441\u043b\u0430, \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u0441\u0440\u0435\u0434\u0438 \u043d\u0438\u0445 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435, \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u0438 \u0438\u0441\u043a\u043b\u044e\u0447\u0430\u0435\u043c \u0438\u0437 \u0441\u043f\u0438\u0441\u043a\u0430, \u0437\u0430\u0442\u0435\u043c \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u0435\u043c \u0434\u0432\u0430 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0438 \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0443\u0436\u0435 \u0438\u0445.<br \/>  4\u0434) \u0434\u043b\u044f <b>Indxs(i)<\/b> = 4, \u0432\u0441\u0435 \u0442\u043e \u0436\u0435, \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043d\u0430\u0445\u043e\u0434\u0438\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445, \u0432\u044b\u0447\u0435\u0440\u043a\u0438\u0432\u0430\u0435\u043c \u0435\u0433\u043e, \u0437\u0430\u0442\u0435\u043c \u0434\u0435\u043b\u0430\u0435\u043c \u0442\u043e\u0436\u0435 \u0447\u0442\u043e \u0438 \u0434\u043b\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 3.<br \/>  4\u0435) \u0435\u0441\u043b\u0438 <b>Indxs(i)<\/b> \u0431\u043e\u043b\u044c\u0448\u0435 4, \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e.<br \/>  \u041e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432  <\/p>\n<table>\n<tr>\n<td>17<\/td>\n<td>21<\/td>\n<td>30<\/td>\n<td>46<\/td>\n<td>55<\/td>\n<td>63<\/td>\n<td>79<\/td>\n<td>82<\/td>\n<td>94<\/td>\n<td>108<\/td>\n<\/tr>\n<\/table>\n<p>  \u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0446\u0435\u043d\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<br \/>  \u041d\u0430 \u043f\u043e\u0438\u0441\u043a \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u043d\u0443\u0436\u0435\u043d \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0445\u043e\u0434 \u2014 <b>n<\/b> \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<br \/>  \u041d\u0430 \u00ab\u0440\u0430\u0437\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435 \u043a\u0430\u043c\u043d\u0435\u0439\u00bb \u0435\u0449\u0435 <b>n<\/b> \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439.<br \/>  \u00ab\u0421\u0431\u043e\u0440 \u043a\u0430\u043c\u043d\u0435\u0439\u00bb \u043f\u043e \u0437\u0430\u0442\u0440\u0430\u0442\u0430\u043c \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0412 \u0434\u0430\u043d\u043d\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0443\u0436\u043d\u043e <b>n<\/b> \u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0439 \u0438 3 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u043f\u0430\u0440\u044b \u0447\u0438\u0441\u0435\u043b.<\/p>\n<p>  \u041f\u0440\u0438 \u0442\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0438 \u043d\u0430 \u043d\u0430\u0431\u043e\u0440\u0430\u0445 \u0441 <b>n<\/b>=10000, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u0445 \u0441 random.org (\u0440\u0435\u0441\u0443\u0440\u0441 \u043d\u0435 \u0434\u0430\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435 10000 \u0447\u0438\u0441\u0435\u043b \u0432 \u043e\u0434\u043d\u043e\u043c \u043d\u0430\u0431\u043e\u0440\u0435) \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u0441\u0442\u0430\u0442\u0438\u0441\u0442\u0438\u043a\u0443: <br \/>  \u041f\u0440\u0438 <b>n<sub>max<\/sub><\/b>=10000. \u0412\u0441\u0435 \u0438\u043d\u0434\u0435\u043a\u0441\u044b = 1, \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0441\u044f \u0437\u0430 3 \u043f\u0440\u043e\u0445\u043e\u0434\u0430 \u043f\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0443.<br \/>  \u041f\u0440\u0438 <b>n<sub>max<\/sub><\/b>=11000. \u041d\u0443\u043b\u0435\u0439 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430: 4547, \u0435\u0434\u0438\u043d\u0438\u0446 906, \u0434\u0432\u043e\u0435\u043a :4547, \u0442\u0440\u043e\u0435\u043a \u0438 \u0431\u043e\u043b\u0435\u0435:0 \u0422\u0435 \u0436\u0435 \u0442\u0440\u0438 \u043f\u0440\u043e\u0445\u043e\u0434\u0430 \u043f\u043b\u044e\u0441 \u043f\u043e\u0447\u0442\u0438 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u0430 \u043e\u0442 <b>n<\/b> \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 2-\u0445 \u0447\u0438\u0441\u0435\u043b. <br \/>  \u041f\u0440\u0438 <b>n<sub>max<\/sub><\/b>=21000 Zeroes:3967 Ones:2845 Twos:2409 Threes:779 Fours:0 <br \/>  \u041f\u0440\u0438 <b>n<sub>max<\/sub><\/b>=31000 Zeroes:3881 Ones:3134 Twos:2197 Threes:680 Fours:108 More_than_four:0<br \/>  \u041f\u0440\u0438 <b>n<sub>max<\/sub><\/b>=101000 max in index:6 Zeroes:3729 Ones:3541 Twos:1923 Threes:643 Fours:139 More_than_four:25 <br \/>  \u0432\u0441\u0435\u0433\u043e 25 \u0432\u044b\u0437\u043e\u0432\u043e\u0432 \u0432\u0442\u043e\u0440\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438. <\/p>\n<p>  \u0418\u043d\u0442\u0443\u0438\u0442\u0438\u0432\u043d\u043e, \u0432 \u0441\u0430\u043c\u043e\u043c \u0445\u0443\u0434\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0431\u0443\u0434\u0435\u0442 \u0441\u043e\u0432\u0435\u0440\u0448\u0435\u043d\u043e <b>n\/5<\/b> \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439. <br \/>  \u0412 \u0441\u0440\u0435\u0434\u043d\u0435\u043c, \u043d\u0430\u0432\u0441\u043a\u0438\u0434\u043a\u0443, \u0447\u0438\u0441\u043b\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 <b>4n<\/b><\/p>\n<p>  \u042d\u0442\u043e\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0441\u044f \u043a \u0433\u0440\u0443\u043f\u043f\u0435 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043e\u043a \u0431\u0435\u0437 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0439 \u0438 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0439 \u0432\u0435\u0440\u0441\u0438\u0435\u0439 \u043c\u0435\u0436\u0434\u0443 \u043a\u0430\u0440\u043c\u0430\u043d\u043d\u043e\u0439 \u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0441 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u043e\u043c.<\/p>\n<p>  \u0413\u043b\u0430\u0432\u043d\u0430\u044f \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u043e\u0434\u0441\u0447\u0435\u0442\u043e\u043c \u2014 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043f\u043e\u043f\u0430\u0434\u0430\u044e\u0449\u0438\u0435 \u0432 \u043e\u0434\u043d\u0443 \u044f\u0447\u0435\u0439\u043a\u0443, \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0438\u043c\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0447\u0438\u0441\u0435\u043b \u0432 \u044f\u0447\u0435\u0439\u043a\u0435 \u0431\u043e\u043b\u044c\u0448\u0435 4-\u0445. <br \/>  \u041d\u043e, \u0432\u043e-\u043f\u0435\u0440\u0432\u044b\u0445, \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u0445\u043e\u0440\u043e\u0448\u0438\u0439 \u0433\u0430\u043d\u0434\u0438\u043a\u0430\u043f \u0437\u0430 \u0441\u0447\u0435\u0442 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438 \u043f\u0430\u0440 \u0447\u0438\u0441\u0435\u043b.<br \/>  \u0412\u043e-\u0432\u0442\u043e\u0440\u044b\u0445, \u0447\u0438\u0441\u043b\u043e \u0431\u0443\u0440\u0441\u0442\u043e\u0432 \u043e\u0431\u044b\u0447\u043d\u043e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0435\u0432\u0435\u043b\u0438\u043a\u043e, \u043c\u0435\u043d\u0435\u0435 \u043e\u0434\u043d\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u043d\u0442\u0430.<br \/>  \u0412-\u0442\u0440\u0435\u0442\u044c\u0438\u0445, \u0443\u0436\u0435 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0443\u0440\u0441\u0442\u044b \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u043e\u0442\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f. \u041a \u0442\u043e\u043c\u0443 \u0436\u0435 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u0441\u043d\u0438\u043c\u0430\u0435\u0442\u0441\u044f \u043e\u0433\u0440\u0430\u043d\u0438\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u043f\u043e\u0432\u0442\u043e\u0440\u043e\u0432 \u0432\u043e \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0415\u0441\u043b\u0438 \u043d\u0430\u043c \u043f\u043e\u043f\u0430\u0434\u0430\u0435\u0442\u0441\u044f \u0431\u0443\u0440\u0441\u0442 \u0438\u0437 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0442\u043e \u0434\u043b\u044f \u043d\u0435\u0433\u043e \u0434\u0435\u043b\u044c\u0442\u0430 <b>d=(n<sub>max<\/sub>-n<sub>min<\/sub>) \/n=0<\/b> \u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u0441\u043c\u0435\u043b\u043e \u0432\u0435\u0441\u044c \u0431\u0443\u0440\u0441\u0442 \u0441\u043a\u043e\u043f\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043d\u0430 \u0432\u044b\u0445\u043e\u0434.<\/p>\n<p>  \u041f\u0440\u043e\u0431\u043b\u0435\u043c\u0430 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c\u043e\u0441\u0442\u0438 \u044d\u0442\u043e\u0433\u043e \u0441\u043f\u043e\u0441\u043e\u0431\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0446\u0435\u043b\u044b\u0445 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0442\u043e\u0436\u0435 \u0432\u043f\u043e\u043b\u043d\u0435 \u0440\u0435\u0448\u0430\u0435\u043c\u0430. <\/p>\n<p>  \u0411\u0435\u0437\u0443\u0441\u043b\u043e\u0432\u043d\u043e, \u0434\u0430\u043d\u043d\u044b\u0439 \u0441\u043f\u043e\u0441\u043e\u0431 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u0435\u0439 \u043e\u0431\u043a\u0430\u0442\u043a\u0438 \u0438 \u0432\u044b\u044f\u0432\u043b\u0435\u043d\u0438\u044f \u043f\u043e\u0434\u0432\u043e\u0434\u043d\u044b\u0445 \u043a\u0430\u043c\u043d\u0435\u0439. <\/p>\n<p>  \u041f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0430:<br \/>  \u0421\u043a\u043e\u0440\u043e\u0441\u0442\u044c, \u043b\u0435\u0433\u043a\u043e\u0441\u0442\u044c \u043f\u043e\u043d\u0438\u043c\u0430\u043d\u0438\u044f \u0438 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f.<br \/>  \u041d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043a\u0438:<br \/>  \u0414\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043d\u0438\u044f \u043a \u043f\u0430\u043c\u044f\u0442\u0438, \u0437\u0430\u0432\u0438\u0441\u044f\u0449\u0438\u0435 \u043e\u0442 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. \u0427\u0442\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u0441\u043a\u043e\u043c\u043f\u0435\u043d\u0441\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0431\u043e\u043b\u0435\u0435 \u0440\u0430\u0446\u0438\u043e\u043d\u0430\u043b\u044c\u043d\u043e\u0439 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <b> N<sub>new<\/sub><\/b>. \u0412 \u043b\u044e\u0431\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0443\u0436\u043d\u043e \u043d\u0435 \u043c\u0435\u043d\u0435\u0435 3n.    \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\/208088\/\"> http:\/\/habrahabr.ru\/post\/208088\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div class=\"content html_format\">   \t\u0414\u043e\u0431\u0440\u043e\u0433\u043e \u041d\u043e\u0432\u043e\u0433\u043e \u0413\u043e\u0434\u0430!<\/p>\n<p>  \u0412 \u043a\u043e\u043f\u0438\u043b\u043a\u0443 \u044d\u043a\u0437\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0443 \u0435\u0449\u0435 \u043e\u0434\u0438\u043d, \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u0432\u043e\u0435\u043e\u0431\u0440\u0430\u0437\u043d\u044b\u0439, \u043d\u043e \u043e\u0431\u0435\u0449\u0430\u044e\u0449\u0438\u0439 \u043f\u0440\u0438\u043b\u0438\u0447\u043d\u0443\u044e \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u044c \u043f\u0440\u0438 \u0445\u043e\u0440\u043e\u0448\u043e \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u041f\u0443\u0441\u0442\u044c \u0438\u043c\u0435\u0435\u0442\u0441\u044f \u043d\u0430\u0431\u043e\u0440 <b>N<\/b> \u0438\u0437 <b>n<\/b> \u0446\u0435\u043b\u044b\u0445 \u043f\u043e\u043b\u043e\u0436\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043e\u0442 <b>1<\/b> \u0434\u043e <b>n<\/b>. <br \/>  \u0421\u0430\u043c\u043e\u043e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f <b>n<\/b> \u0447\u0438\u0441\u0435\u043b \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0438\u043c\u0435\u0442\u044c <b>n<\/b> \u044f\u0447\u0435\u0435\u043a. \u0412\u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e\u0441\u0442\u0438 \u043e\u0442 \u043f\u043e\u0440\u044f\u0434\u043a\u0430, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0447\u0438\u0441\u043b\u0430 \u0431\u0443\u0434\u0443\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u044b.<\/p>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432  <\/p>\n<table>\n<tr>\n<td>3<\/td>\n<td>5<\/td>\n<td> 2<\/td>\n<td>1<\/td>\n<td>8<\/td>\n<td>4<\/td>\n<td>7<\/td>\n<td>6<\/td>\n<td>9<\/td>\n<td>10<\/td>\n<\/tr>\n<\/table>\n<p>  \u041d\u0435\u0441\u043b\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 <b>N<\/b> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u0438\u0442\u044c \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u043c (\u043f\u043e \u0432\u043e\u0437\u0440\u0430\u0441\u0442\u0430\u043d\u0438\u044e, \u0438\u043b\u0438 \u043f\u043e \u0443\u0431\u044b\u0432\u0430\u043d\u0438\u044e), \u0437\u0430\u043f\u0438\u0441\u0430\u0432 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u043d\u0435\u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u043e\u0433\u043e. <\/p>\n<p>  \u0423\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432  <\/p>\n<table>\n<tr>\n<td>1<\/td>\n<td>2<\/td>\n<td>3<\/td>\n<td>4<\/td>\n<td>5<\/td>\n<td>6<\/td>\n<td>7<\/td>\n<td>8<\/td>\n<td>9<\/td>\n<td>10<\/td>\n<\/tr>\n<\/table>\n<p>  <\/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-208088","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208088","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=208088"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/208088\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=208088"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=208088"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=208088"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}