{"id":413420,"date":"2024-06-29T23:07:04","date_gmt":"2024-06-29T23:07:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=413420"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=413420","title":{"rendered":"<span>\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439. \u041f\u043e\u0432\u044b\u0448\u0435\u043d\u0438\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0427\u0430\u0441\u0442\u044c 1<\/span>"},"content":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0421\u043b\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430?<\/h2>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c62\/4e4\/143\/c624e414335289e6bb0f07a9e29dc0c8.png\" width=\"767\" height=\"767\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c62\/4e4\/143\/c624e414335289e6bb0f07a9e29dc0c8.png\"\/><\/figure>\n<p>\u0414\u0430, \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0431\u0430\u0439\u0442, \u0438\u043b\u0438 \u0434\u0432\u0443\u0445 LONG \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u0430\u043a\u043e\u0433\u043e \u0442\u043e \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0414\u0430\u0436\u0435 \u0432 \u0448\u043a\u043e\u043b\u0435 \u043c\u044b \u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0438\u0437\u0443\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u043e \u043d\u0430\u043c \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043e\u0442 1 \u0434\u043e 10.<\/p>\n<p>\u041d\u043e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u043b\u0438\u043d\u044b? \u041d\u0435 LONG, \u043d\u0435 \u0431\u0430\u0439\u0442, \u043d\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0442 1 \u0434\u043e 10, \u0430 \u043b\u044e\u0431\u044b\u0435 \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435, \u0438\u043c\u0435\u044e\u0442 \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u0438\u043d\u0443 <em>n<\/em> \u0431\u0438\u0442, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u043b\u0438\u043d\u0443 <em>2n<\/em> \u0431\u0438\u0442.<\/p>\n<p>\u0412 \u0448\u043a\u043e\u043b\u0435 \u0432\u0441\u0435 \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f &#171;\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c&#187;. \u041e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441 \u0432\u044b\u0440\u0443\u0447\u0430\u043b \u0432 \u0434\u043e\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u043d\u0443\u044e \u044d\u0440\u0443, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0435\u0433\u043e \u043a \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435.<\/p>\n<p>\u0412 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0442\u043e, \u0447\u0435\u043c\u0443 \u043d\u0430\u0441 \u0443\u0447\u0438\u043b\u0438 \u0432 \u0448\u043a\u043e\u043b\u0435 \u0434\u043b\u044f \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0411\u0435\u0440\u0435\u043c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 <em>x<\/em> \u0438 <em>y<\/em> \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0447\u0438\u0441\u043b\u0430 <em>x<\/em> \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u043b\u0435\u0432\u043e \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 <em>y<\/em>.<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/99c\/c4a\/3c9\/99cc4a3c915440dfc10104de372e0a33.png\" width=\"789\" height=\"303\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/99c\/c4a\/3c9\/99cc4a3c915440dfc10104de372e0a33.png\"\/><\/figure>\n<p>\u0415\u0441\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u043a\u0430\u043a\u043e\u0432\u0430 \u044d\u0442\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c? \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0438 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 \u044d\u0442\u043e \u0441\u0435\u043c\u0435\u0447\u043a\u0438. \u041e\u043d \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0443\u043c\u0435\u0435\u0442 \u0441\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430. \u0410 \u0432\u043e\u0442 \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u044d\u0442\u0438 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435\u2026<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043d\u0430 <em>n<\/em> \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0432\u043b\u0435\u0432\u043e, \u0437\u043d\u0430\u0447\u0438\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0432 <em>2n<\/em> \u0431\u0438\u0442. \u0427\u0442\u043e\u0431\u044b \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u043e\u0439 2n \u0431\u0438\u0442, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430, \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u0440\u0430\u0437\u0440\u044f\u0434\u044b \u0447\u0438\u0441\u0435\u043b \u043e\u0442 \u043c\u043b\u0430\u0434\u0448\u0435\u0433\u043e \u043a \u0441\u0442\u0430\u0440\u0448\u0435\u043c\u0443. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0443\u043c\u043c\u0443 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u0440\u044f\u0434\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441 (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c), \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0440\u044f\u0434\u0430. \u0412\u0441\u0435 \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f <em>O(1)<\/em>. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u043e\u0439 <em>2n<\/em> \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f <em>O(2n)<\/em> \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e <em>O(n)<\/em>, \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <em>xy<\/em> \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043b\u043e\u0436\u0438\u0442\u044c, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c <em>n<\/em> \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u0434\u043b\u0438\u043d\u043e\u0439 <em>2n<\/em>. \u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <em>O(n)<\/em>, \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d \u044d\u0442\u043e <em>O(n<sup>2<\/sup>)<\/em><\/p>\n<p>\u0418 \u0442\u0443\u0442 \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u044b <em>n<\/em> \u0431\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u0447\u0435\u043c <em>O(n<sup>2<\/sup>)<\/em>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u0438 (\u0441\u043f\u043e\u0439\u043b\u0435\u0440\u044b) \u0414\u0430! \u0422\u0430\u043a\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442!<\/p>\n<h2>\u041b\u0435\u043d\u0438\u0432\u044b\u0439 \u0413\u0430\u0443\u0441\u0441<\/h2>\n<figure class=\"float full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/840\/b5a\/24a\/840b5a24a8d8838c8082acf68aa60f48.png\" width=\"767\" height=\"767\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/840\/b5a\/24a\/840b5a24a8d8838c8082acf68aa60f48.png\"\/><\/figure>\n<p>\u0418\u043e\u0433\u0430\u043d\u043d \u0413\u0430\u0443\u0441\u0441 \u0431\u044b\u043b \u0433\u0435\u043d\u0438\u0430\u043b\u0435\u043d, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u043d\u0438\u0432. \u0413\u0430\u0443\u0441\u0441\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0447\u0430\u0441\u0442\u043e \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u0435\u043b \u0440\u0430\u0437\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u043e\u043d \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<p>\u0413\u0430\u0443\u0441\u0441 \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u0438\u0445. \u041c\u044b \u0438 \u0441\u0430\u043c\u0438 \u044d\u0442\u043e \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0430\u0431\u0437\u0430\u0446\u0435. \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u044b n \u0431\u0438\u0442 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <em>O(n<sup>2<\/sup>)<\/em> \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u0430\u043a \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0436\u0435 \u0447\u0438\u0441\u0435\u043b \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <em>O(n)<\/em>  <\/p>\n<p>\u0413\u0430\u0443\u0441\u0441 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"(a+ib)(c+id)=ac-bd+i(bc+ad)\" alt=\"(a+ib)(c+id)=ac-bd+i(bc+ad)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d51\/6e7\/6b5\/d516e76b586b1d70e7e126d52e9e6b24.svg\" width=\"319\" height=\"22\"\/><\/p>\n<p>\u0418 \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 4 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f <strong><em>[ac, bd, bc, ad]<\/em><\/strong><\/p>\n<p>\u0410 \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f: <strong><em>[ac, bd, (a+b)(c+d)]<\/em><\/strong><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"\u0412\u0435\u0434\u044c: bc+ad=(a+b)(c+d)-ac-bd\" alt=\"\u0412\u0435\u0434\u044c: bc+ad=(a+b)(c+d)-ac-bd\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8d9\/0ed\/463\/8d90ed463ed658fd720e842c51160624.svg\" width=\"334\" height=\"22\"\/><\/p>\n<p>\u041a\u0440\u0430\u0441\u0438\u0432\u043e, \u043d\u0430 25% \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0442\u0430\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u041d\u043e \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432 \u043d\u043e\u0442\u0430\u0446\u0438\u044f\u0445 <em>O(&#8230;)<\/em> \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0438\u043c\u0435\u0435\u0442 \u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c <em>O(4n<sup>2<\/sup>)<\/em> \u0438\u043b\u0438 <em>O(3n<sup>2<\/sup>)<\/em>, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u043c\u044b \u0432 \u044d\u0442\u043e\u0439 \u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c.<\/p>\n<p>\u041d\u043e \u0441\u0430\u043c\u0430 \u0438\u0434\u0435\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0442\u0430\u043a \u0443\u0436\u0435 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0430. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0430\u0431\u0437\u0430\u0446\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 <em>x<\/em> \u0438 <em>y<\/em> \u0434\u043b\u0438\u043d\u043e\u0439 <em>n<\/em> \u0431\u0438\u0442.<\/p>\n<p>\u201c\u0420\u0430\u0437\u0440\u0435\u0436\u0435\u043c\u201d \u044d\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u043f\u043e\u043b\u0430\u043c \u043d\u0430 \u0441\u0442\u0430\u0440\u0448\u0443\u044e (\u043b\u0435\u0432\u0443\u044e) \u0447\u0430\u0441\u0442\u044c \u0434\u043b\u0438\u043d\u043e\u0439 <em>n\/2<\/em> \u0431\u0438\u0442\u0430 \u0438 \u043c\u043b\u0430\u0434\u0448\u0443\u044e (\u043f\u0440\u0430\u0432\u0443\u044e) \u0447\u0430\u0441\u0442\u044c \u0434\u043b\u0438\u043d\u043e\u0439 <em>n\/2<\/em> \u0431\u0438\u0442\u0430. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u043d\u043e\u0432\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"x_L,x_R,y_L,y_R\" alt=\"x_L,x_R,y_L,y_R\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/564\/845\/826\/564845826106080f16d71ef3b313b421.svg\" width=\"114\" height=\"15\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"x=[x_Lx_R]=2^{n\/2}x_L+x_R\" alt=\"x=[x_Lx_R]=2^{n\/2}x_L+x_R\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6f6\/33e\/195\/6f633e195f7947470bb5aabaa8b0c1a9.svg\" width=\"221\" height=\"26\"\/><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"y=[y_Ly_R]=2^{n\/2}y_L+y_R\" alt=\"y=[y_Ly_R]=2^{n\/2}y_L+y_R\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/95b\/570\/47d\/95b57047d942486ce4aa97ab914b9ef8.svg\" width=\"213\" height=\"26\"\/><\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"x=10110110_2; x_L=1011_2; x_R=0110_2 \\quad\u0438\\quad x=2^4\\cdot1011_2 +0110_2\" alt=\"x=10110110_2; x_L=1011_2; x_R=0110_2 \\quad\u0438\\quad x=2^4\\cdot1011_2 +0110_2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3e4\/7c9\/4a9\/3e47c94a92acab228c181f558686998b.svg\" width=\"566\" height=\"24\"\/><\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <em>xy<\/em> \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u0430\u043a  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"xy=(2^{n\/2}x_L+x_R)(2^{n\/2}y_L+y_R)=2^nx_Ly_L+2^{n\/2}(x_Ly_R+x_Ry_L)+x_Ry_R \\quad(1)\" alt=\"xy=(2^{n\/2}x_L+x_R)(2^{n\/2}y_L+y_R)=2^nx_Ly_L+2^{n\/2}(x_Ly_R+x_Ry_L)+x_Ry_R \\quad(1)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/725\/22b\/495\/72522b495f7eeb3487bcd555f48183a6.svg\" width=\"663\" height=\"26\"\/><\/p>\n<p>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <em>xy<\/em>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438? \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 <em>2<sup>n<\/sup><\/em> \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433, \u044d\u0442\u043e \u0434\u0430\u0436\u0435 \u0437\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f. \u0422\u0440\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f <em>O(n)<\/em>. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f:\u00a0 <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"x_Ly_L, x_Ly_R,x_Ry_L,x_Ry_R\" alt=\"x_Ly_L, x_Ly_R,x_Ry_L,x_Ry_R\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/256\/aa8\/0bd\/256aa80bd059f43a2cfa20b98942346d.svg\" width=\"202\" height=\"15\"\/><\/p>\n<p>\u041d\u043e, \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0434\u043b\u0438\u043d\u043e\u044e <em>n<\/em> \u0431\u0438\u0442, \u0430 \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0434\u043b\u0438\u043d\u043e\u044e <em>n\/2<\/em> \u0431\u0438\u0442. \u041f\u0440\u0430\u0432\u0434\u0430, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0445 \u0441\u0442\u0430\u043b\u043e \u0447\u0435\u0442\u044b\u0440\u0435.\u00a0<\/p>\n<p>\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u0439 1 \u0431\u0438\u0442 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u044d\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f AND \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u043e\u0439 <em>n<\/em>=2 \u0431\u0438\u0442, \u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b, \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u043b\u0438\u043d\u043e\u044e 1 \u0431\u0438\u0442.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u043e\u044e <em>n<\/em>=4 \u0431\u0438\u0442, \u0442\u043e \u043c\u044b \u0435\u0433\u043e \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b, \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u043b\u0438\u043d\u043e\u044e 2 \u0431\u0438\u0442, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f 16 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u044e 1 \u0431\u0438\u0442.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u044e <em>n<\/em> \u0431\u0438\u0442 \u044d\u0442\u0438\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c, \u043a\u0430\u043a <em>T(n)<\/em>, \u0442\u043e \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f <em>T(n\/2)<\/em> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0432\u0438\u0433\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 <em>O(n)<\/em>.<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"T(n)=4T(n\/2)+O(n)\" alt=\"T(n)=4T(n\/2)+O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/33d\/3a9\/ab6\/33d3a9ab61347eb4ada4f149646ca8c6.svg\" width=\"200\" height=\"22\"\/><\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u0433\u043e, \u043e\u0442\u0432\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 <em>T(n)=O(n<sup>2<\/sup>)<\/em><\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b, \u0438 \u043e\u043d \u0434\u0430\u0435\u0442 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c, \u043a\u0430\u043a \u0438 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d. \u041e\u0431\u0438\u0434\u043d\u043e!<\/p>\n<p>\u0418 \u0442\u0443\u0442 \u0442\u043e \u043d\u0430\u043c \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0413\u0430\u0443\u0441\u0441. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 (1) \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0447\u0435\u0442\u044b\u0440\u0435, \u0430 \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0435\u0434\u044c<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"x_Ly_R+x_Ry_L=(x_L+x_R)(y_L+y_R)-x_Ry_R-x_Ly_L\" alt=\"x_Ly_R+x_Ry_L=(x_L+x_R)(y_L+y_R)-x_Ry_R-x_Ly_L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/195\/f4b\/da2\/195f4bda2dcb432855258cb856308c65.svg\" width=\"437\" height=\"22\"\/><\/p>\n<p>\u0418 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f <em>n\/2<\/em>-\u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"(x_L+x_R)(y_L+y_R),\\quad x_Ry_R,\\quad x_Ly_L\" alt=\"(x_L+x_R)(y_L+y_R),\\quad x_Ry_R,\\quad x_Ly_L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/cd2\/dff\/bad\/cd2dffbad865c595d6f9edd88ec42051.svg\" width=\"309\" height=\"22\"\/><\/p>\n<p>\u0410 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 &#8212; \u044d\u0442\u043e \u043e\u043f\u044f\u0442\u044c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0432\u0438\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"T(n)=3T(n\/2)+O(n)\" alt=\"T(n)=3T(n\/2)+O(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/72a\/312\/c9e\/72a312c9e5d58940ca2e00bdc2153941.svg\" width=\"200\" height=\"22\"\/><\/p>\n<p>\u0420\u0435\u0448\u0438\u043c \u044d\u0442\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0432 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e. \u041d\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430, \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b <em>xy<\/em> \u0434\u043b\u0438\u043d\u044b <em>n<\/em> \u0431\u0438\u0442.<\/p>\n<p>\u0423\u0440\u043e\u0432\u043d\u0435\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438 \u043d\u0438\u0436\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0442\u0440\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u044b <em>n\/2<\/em><\/p>\n<p>\u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0442\u0432\u0435\u0439 \u0434\u0435\u0440\u0435\u0432\u0430 \u0443\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043b\u0438\u043d\u0430 \u0432 \u0431\u0438\u0442\u0430\u0445 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430.<\/p>\n<p>\u041d\u0430 <em>k<\/em>-\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c <em>3<sup>k<\/sup><\/em> \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 <em>n\/2<sup>k<\/sup><\/em> \u0431\u0438\u0442. \u041d\u0430 <em>k<\/em>-\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u0435\u0449\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0432\u0438\u0433\u0430 \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u044e <em>n\/2<sup>k<\/sup><\/em> \u0431\u0438\u0442, \u0442.\u0435. \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e O(<em>n\/2<sup>k<\/sup><\/em>)<\/p>\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u044e <em>n\/2<sup>k<\/sup><\/em> \u043c\u044b \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>k+1<\/em> \u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438 \u0438 \u043d\u0430 \u043d\u0430\u0448 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043e\u0442\u0432\u0435\u0442. \u041c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0430 <em>k<\/em>-\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e <em>3<sup>k<\/sup><\/em> \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0432\u0438\u0433\u0430, \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 O(<em>n\/2<sup>k<\/sup><\/em>) \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u044b \u0443\u0440\u043e\u0432\u043d\u044e \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0422.\u0435. \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430 <em>k<\/em>-\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438 \u044d\u0442\u043e<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"3^kO(n\/2^k)=(3\/2)^kO(n)\" alt=\"3^kO(n\/2^k)=(3\/2)^kO(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/106\/1b2\/6b4\/1061b26b45992d58a4dc289ce0281c06.svg\" width=\"208\" height=\"25\"\/><\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u043e \u0443\u0440\u043e\u0432\u043d\u044f\u043c \u0434\u0435\u0440\u0435\u0432\u0430, \u044d\u0442\u043e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u0441 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u043c 3\/2<\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435 <em>k<\/em>=0 \u043f\u043e \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e <em>O(n)<\/em><\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u043d\u0438\u0436\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435 <em>k=log<sub>2<\/sub>(n)<\/em> \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439\u00a0<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"(3\/2)^{log_2n}O(n)=\\frac{3^{log_2n}}{2^{log_2n}}O(n)=\\frac{2^{log_23\\cdot log_2n}}{n}O(n)=n^{log_23}O(1)=O(n^{log_23})\" alt=\"(3\/2)^{log_2n}O(n)=\\frac{3^{log_2n}}{2^{log_2n}}O(n)=\\frac{2^{log_23\\cdot log_2n}}{n}O(n)=n^{log_23}O(1)=O(n^{log_23})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f3a\/75f\/2ee\/f3a75f2eec06c6c57580dde45f323466.svg\" width=\"595\" height=\"50\"\/><\/p>\n<p>\u0410 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0445\u043d\u0438\u043c \u0438 \u043d\u0438\u0436\u043d\u0438\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043d\u0435\u0447\u0442\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c <em>3\/2<\/em> \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e \u0440\u0430\u0437.<\/p>\n<p>\u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u043e\u0431\u0449\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u044d\u0442\u043e \u0441\u0443\u043c\u043c\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u0435\u0440\u0435\u0432\u0430, \u0438\u043b\u0438, \u043a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0443\u043c\u043c\u0430 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0441 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u043c <em>3\/2<\/em> \u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0447\u043b\u0435\u043d\u043e\u043c <em>O(n)<\/em><\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"T(n)=\\frac{(3\/2)^{log_2n}O(n)-1}{3\/2-1}=2(3\/2)^{log_2n}O(n)-2=2O(n^{log_23})-2\" alt=\"T(n)=\\frac{(3\/2)^{log_2n}O(n)-1}{3\/2-1}=2(3\/2)^{log_2n}O(n)-2=2O(n^{log_23})-2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c2d\/296\/13e\/c2d29613e581256e76b4996483f32aee.svg\" width=\"554\" height=\"52\"\/><\/p>\n<p>\u041e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f.  <\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"formula\" source=\"T(n)=O(n^{log_23})=O(n^{1.59})\" alt=\"T(n)=O(n^{log_23})=O(n^{1.59})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8a7\/98d\/0d7\/8a798d0d71cfe056b30af67d6a7a714f.svg\" width=\"232\" height=\"25\"\/><\/p>\n<p>\u0418\u0442\u0430\u043a \u043d\u0430\u0448 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439, \u0447\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e <em>O(n<sup>2<\/sup>).<\/em><\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u041a\u0430\u0440\u0430\u0446\u0443\u0431\u044b. \u0412 \u043a\u043e\u043d\u0446\u0435 1950-\u044b\u0445 \u0410\u043d\u0434\u0440\u0435\u0439 \u041a\u043e\u043b\u043c\u043e\u0433\u043e\u0440\u043e\u0432 \u0432\u044b\u0434\u0432\u0438\u043d\u0443\u043b \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 &#171;\u0432 \u0441\u0442\u043e\u043b\u0431\u0438\u043a&#187; \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e <em>O(n<sup>2<\/sup>)<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0441\u0438\u043c\u043f\u0442\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0439 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 <em>\u03a9(n<sup>2<\/sup>)<\/em> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0412 1960-\u043e\u043c, \u041a\u043e\u043b\u043c\u043e\u0433\u043e\u0440\u043e\u0432 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b \u0441\u0435\u043c\u0438\u043d\u0430\u0440 \u043f\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u043a\u0438\u0431\u0435\u0440\u043d\u0435\u0442\u0438\u043a\u0438 \u0432 \u041c\u0413\u0423, \u0433\u0434\u0435 \u043e\u043d \u043e\u0437\u0432\u0443\u0447\u0438\u043b \u044d\u0442\u0443 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443, \u0438 \u0440\u044f\u0434 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0434\u0435\u043b\u0438, 23-\u043b\u0435\u0442\u043d\u0438\u0439 \u0441\u0442\u0443\u0434\u0435\u043d\u0442 \u0410\u043d\u0430\u0442\u043e\u043b\u0438\u0439 \u041a\u0430\u0440\u0430\u0446\u0443\u0431\u0430 \u043d\u0430\u0448\u0435\u043b \u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c  <em>O(n<sup>log(3)<\/sup>)<\/em> \u0438, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0433 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443. \u041a\u043e\u043b\u043c\u043e\u0433\u043e\u0440\u043e\u0432 \u0431\u044b\u043b \u0432\u043e\u0441\u0445\u0438\u0449\u0435\u043d \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c. \u041e\u043d \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u043e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u043d\u044c \u043d\u0430 \u0441\u0435\u043c\u0438\u043d\u0430\u0440\u0435. \u0421 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u041a\u0430\u0440\u0430\u0446\u0443\u0431\u044b \u041a\u043e\u043b\u043c\u043e\u0433\u043e\u0440\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u043a\u0446\u0438\u0439 \u0438 \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u044f\u0445 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043c\u0438\u0440\u0443. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0431\u044b\u043b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u0432 1962 \u0433\u043e\u0434\u0443: \u042e. \u041f. \u041e\u0444\u043c\u0430\u043d, \u0410. \u0410. \u041a\u0430\u0440\u0430\u0446\u0443\u0431\u0430, \u00ab\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430\u0445\u00bb \u0414\u043e\u043a\u043b\u0430\u0434\u044b \u0410\u041d \u0421\u0421\u0421\u0420. \u2014 1962 \u2014 \u0422. 145. \u2014 \u0421. 293\u2014294.<\/p>\n<p>\u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u0438\u0442\u043e\u0433. \u0427\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c?<\/p>\n<p>\u041c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0443 \u0434\u043b\u0438\u043d\u044b <em>n<\/em> \u043d\u0430 3 \u0437\u0430\u0434\u0430\u0447\u0438\u00a0 \u0434\u043b\u0438\u043d\u044b <em>n\/2<\/em> \u0438 \u0432\u0434\u0440\u0443\u0433, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435!<\/p>\n<p>\u0410 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f?<\/p>\n<p>\u0414\u0430, \u043c\u043e\u0436\u043d\u043e!<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u00ab\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439\u00bb \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u00ab\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439\u00bb \u0434\u0430\u0435\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432\u00a0\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u00a0\u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u0430\u00a0\u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0442. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0433\u0434\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u00ab\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439\u00bb \u0434\u0430\u043b \u043e\u0449\u0443\u0442\u0438\u043c\u044b\u0439 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/habr.com\/ru\/articles\/742404\/\" rel=\"noopener noreferrer nofollow\">\u0432\u0442\u043e\u0440\u0443\u044e \u0447\u0430\u0441\u0442\u044c<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/742308\/\"> https:\/\/habr.com\/ru\/articles\/742308\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<div><!--[--><!--]--><\/div>\n<div id=\"post-content-body\">\n<div>\n<div class=\"article-formatted-body article-formatted-body article-formatted-body_version-2\">\n<div xmlns=\"http:\/\/www.w3.org\/1999\/xhtml\">\n<h2>\u0421\u043b\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430?<\/h2>\n<figure class=\"float full-width\"><\/figure>\n<p>\u0414\u0430, \u043c\u044b \u043f\u0440\u0438\u0432\u044b\u043a\u043b\u0438, \u0447\u0442\u043e \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0431\u0430\u0439\u0442, \u0438\u043b\u0438 \u0434\u0432\u0443\u0445 LONG \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0438 \u043d\u0435 \u0442\u0440\u0435\u0431\u0443\u0435\u0442 \u043a\u0430\u043a\u043e\u0433\u043e \u0442\u043e \u043e\u0441\u043e\u0431\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0414\u0430\u0436\u0435 \u0432 \u0448\u043a\u043e\u043b\u0435 \u043c\u044b \u0443\u0447\u0438\u043b\u0438 \u043d\u0430\u0438\u0437\u0443\u0441\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u0443 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f, \u0447\u0442\u043e \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u043b\u043e \u043d\u0430\u043c \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043b\u044e\u0431\u043e\u0439 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u043e\u0442 1 \u0434\u043e 10.<\/p>\n<p>\u041d\u043e, \u0447\u0442\u043e \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u043b\u044e\u0431\u043e\u0439 \u0434\u043b\u0438\u043d\u044b? \u041d\u0435 LONG, \u043d\u0435 \u0431\u0430\u0439\u0442, \u043d\u0435 \u0447\u0438\u0441\u043b\u043e \u043e\u0442 1 \u0434\u043e 10, \u0430 \u043b\u044e\u0431\u044b\u0435 \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u043e\u0435, \u0438\u043c\u0435\u044e\u0442 \u0432 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0434\u043b\u0438\u043d\u0443 <em>n<\/em> \u0431\u0438\u0442, \u0430 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043c\u043e\u0436\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0434\u043b\u0438\u043d\u0443 <em>2n<\/em> \u0431\u0438\u0442.<\/p>\n<p>\u0412 \u0448\u043a\u043e\u043b\u0435 \u0432\u0441\u0435 \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f &#171;\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c&#187;. \u041e\u0442\u043b\u0438\u0447\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u043d\u0430\u0441 \u0432\u044b\u0440\u0443\u0447\u0430\u043b \u0432 \u0434\u043e\u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u043d\u0443\u044e \u044d\u0440\u0443, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044f \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b.<\/p>\n<p>\u0414\u0430\u0432\u0430\u0439\u0442\u0435 \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u043c \u0435\u0433\u043e \u043a \u043d\u0430\u0448\u0435\u0439 \u0437\u0430\u0434\u0430\u0447\u0435.<\/p>\n<p>\u0412 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0432\u0441\u0435 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0442\u043e, \u0447\u0435\u043c\u0443 \u043d\u0430\u0441 \u0443\u0447\u0438\u043b\u0438 \u0432 \u0448\u043a\u043e\u043b\u0435 \u0434\u043b\u044f \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b. \u0411\u0435\u0440\u0435\u043c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 <em>x<\/em> \u0438 <em>y<\/em> \u0432 \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0438. \u0427\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435, \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0440\u0430\u0437 \u0447\u0438\u0441\u043b\u0430 <em>x<\/em> \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u044b\u0435 \u0432\u043b\u0435\u0432\u043e \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u0432\u0441\u0435\u0445 \u043d\u0435\u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 <em>y<\/em>.<\/p>\n<figure class=\"full-width\"><\/figure>\n<p>\u0415\u0441\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0441 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u043c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435\u043c, \u043d\u043e \u043a\u0430\u043a\u043e\u0432\u0430 \u044d\u0442\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c? \u0414\u043b\u044f \u043a\u043e\u043c\u043f\u044c\u044e\u0442\u0435\u0440\u0430, \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0442\u0438 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435 \u044d\u0442\u043e \u0441\u0435\u043c\u0435\u0447\u043a\u0438. \u041e\u043d \u043e\u0447\u0435\u043d\u044c \u0445\u043e\u0440\u043e\u0448\u043e \u0443\u043c\u0435\u0435\u0442 \u0441\u0434\u0432\u0438\u0433\u0430\u0442\u044c \u0434\u0432\u043e\u0438\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430. \u0410 \u0432\u043e\u0442 \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u044d\u0442\u0438 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0435\u2026<\/p>\n<p>\u0412 \u043e\u0431\u0449\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u043c\u043e\u0436\u0435\u0442 \u0431\u044b\u0442\u044c \u0441\u0434\u0432\u0438\u043d\u0443\u0442\u043e \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u043d\u0430 <em>n<\/em> \u043f\u043e\u0437\u0438\u0446\u0438\u0439 \u0432\u043b\u0435\u0432\u043e, \u0437\u043d\u0430\u0447\u0438\u0442 \u043a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u043e\u0435 \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c \u0432 <em>2n<\/em> \u0431\u0438\u0442. \u0427\u0442\u043e\u0431\u044b \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u043e\u0439 2n \u0431\u0438\u0442, \u043c\u044b \u0442\u0430\u043a\u0436\u0435 \u043c\u043e\u0436\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u043d\u0438\u0442\u044c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u044d\u0442\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043e\u0447\u0435\u0432\u0438\u0434\u043d\u0430, \u043c\u044b \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u0440\u0430\u0437\u0440\u044f\u0434\u044b \u0447\u0438\u0441\u0435\u043b \u043e\u0442 \u043c\u043b\u0430\u0434\u0448\u0435\u0433\u043e \u043a \u0441\u0442\u0430\u0440\u0448\u0435\u043c\u0443. \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0443\u043c\u043c\u0443 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u0440\u044f\u0434\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441 (\u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c), \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043d\u043e\u0441 \u0434\u043b\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0433\u043e \u0440\u0430\u0437\u0440\u044f\u0434\u0430. \u0412\u0441\u0435 \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0434\u043b\u044f \u043e\u0434\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u0440\u044f\u0434\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f <em>O(1)<\/em>. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043b\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u043e\u0439 <em>2n<\/em> \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u0432\u0440\u0435\u043c\u044f <em>O(2n)<\/em> \u0438\u043b\u0438 \u043f\u0440\u043e\u0441\u0442\u043e <em>O(n)<\/em>, \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c, \u043a\u0430\u043a \u044d\u0442\u043e \u043f\u0440\u0438\u043d\u044f\u0442\u043e, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0435 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0438.<\/p>\n<p>\u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <em>xy<\/em> \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0441\u043b\u043e\u0436\u0438\u0442\u044c, \u043c\u0430\u043a\u0441\u0438\u043c\u0443\u043c <em>n<\/em> \u0441\u043b\u0430\u0433\u0430\u0435\u043c\u044b\u0445 \u0434\u043b\u0438\u043d\u043e\u0439 <em>2n<\/em>. \u041a\u0430\u0436\u0434\u043e\u0435 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <em>O(n)<\/em>, \u0437\u043d\u0430\u0447\u0438\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d \u044d\u0442\u043e <em>O(n<sup>2<\/sup>)<\/em><\/p>\n<p>\u0418 \u0442\u0443\u0442 \u0438 \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432\u043e\u043f\u0440\u043e\u0441: \u0430 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u044b <em>n<\/em> \u0431\u0438\u0442 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c, \u0447\u0435\u043c <em>O(n<sup>2<\/sup>)<\/em>.<\/p>\n<p>\u0414\u0430\u043b\u0435\u0435 \u043c\u044b \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043f\u043e\u0438\u0441\u043a\u0430\u0442\u044c \u0442\u0430\u043a\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b, \u0438 (\u0441\u043f\u043e\u0439\u043b\u0435\u0440\u044b) \u0414\u0430! \u0422\u0430\u043a\u0438\u0435 \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u0441\u043f\u043e\u0441\u043e\u0431\u044b \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0441\u0443\u0449\u0435\u0441\u0442\u0432\u0443\u044e\u0442!<\/p>\n<h2>\u041b\u0435\u043d\u0438\u0432\u044b\u0439 \u0413\u0430\u0443\u0441\u0441<\/h2>\n<figure class=\"float full-width\"><\/figure>\n<p>\u0418\u043e\u0433\u0430\u043d\u043d \u0413\u0430\u0443\u0441\u0441 \u0431\u044b\u043b \u0433\u0435\u043d\u0438\u0430\u043b\u0435\u043d, \u043d\u043e \u043e\u0447\u0435\u043d\u044c \u043b\u0435\u043d\u0438\u0432. \u0413\u0430\u0443\u0441\u0441\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0447\u0430\u0441\u0442\u043e \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u043c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u0435\u043b \u0440\u0430\u0437\u043d\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0431\u0435\u0437 \u043a\u0430\u043a\u043e\u0433\u043e-\u043b\u0438\u0431\u043e \u043a\u0430\u043b\u044c\u043a\u0443\u043b\u044f\u0442\u043e\u0440\u0430 \u0438 \u043e\u043d \u043d\u0430\u0447\u0430\u043b \u0438\u0441\u043a\u0430\u0442\u044c \u0441\u043f\u043e\u0441\u043e\u0431 \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u043e \u0442\u0430\u043a, \u0447\u0442\u043e\u0431\u044b \u0440\u0430\u0431\u043e\u0442\u0430\u0442\u044c \u043a\u0430\u043a \u043c\u043e\u0436\u043d\u043e \u043c\u0435\u043d\u044c\u0448\u0435.<\/p>\n<p>\u0413\u0430\u0443\u0441\u0441 \u0431\u044b\u0441\u0442\u0440\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0442\u044c \u0447\u0438\u0441\u043b\u0430 \u0433\u043e\u0440\u0430\u0437\u0434\u043e \u043f\u0440\u043e\u0449\u0435, \u0447\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0430\u0442\u044c \u0438\u0445. \u041c\u044b \u0438 \u0441\u0430\u043c\u0438 \u044d\u0442\u043e \u0443\u0432\u0438\u0434\u0435\u043b\u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0430\u0431\u0437\u0430\u0446\u0435. \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u044b n \u0431\u0438\u0442 \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <em>O(n<sup>2<\/sup>)<\/em> \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f, \u043a\u0430\u043a \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u0435 \u0442\u0430\u043a\u0438\u0445 \u0436\u0435 \u0447\u0438\u0441\u0435\u043b \u0438\u043c\u0435\u0435\u0442 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c <em>O(n)<\/em>  <\/p>\n<p>\u0413\u0430\u0443\u0441\u0441 \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u043b \u043d\u0430 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u0443\u044e \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043a\u043e\u043c\u043f\u043b\u0435\u043a\u0441\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b<\/p>\n<p>\u0418 \u0437\u0430\u043c\u0435\u0442\u0438\u043b, \u0447\u0442\u043e \u0432 \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 4 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f <strong><em>[ac, bd, bc, ad]<\/em><\/strong><\/p>\n<p>\u0410 \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f: <strong><em>[ac, bd, (a+b)(c+d)]<\/em><\/strong><\/p>\n<p>\u041a\u0440\u0430\u0441\u0438\u0432\u043e, \u043d\u0430 25% \u0440\u0430\u0431\u043e\u0442\u044b \u0441\u0442\u0430\u043b\u043e \u043c\u0435\u043d\u044c\u0448\u0435. \u041d\u043e \u0432 \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0445 \u0440\u0435\u0430\u043b\u0438\u044f\u0445, \u043a\u043e\u0433\u0434\u0430 \u043c\u044b \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0435\u043c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0432 \u043d\u043e\u0442\u0430\u0446\u0438\u044f\u0445 <em>O(&#8230;)<\/em> \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u043d\u0438\u043a\u0430\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0438\u043c\u0435\u0435\u0442 \u043b\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c <em>O(4n<sup>2<\/sup>)<\/em> \u0438\u043b\u0438 <em>O(3n<sup>2<\/sup>)<\/em>, \u043f\u043e\u0441\u0442\u043e\u044f\u043d\u043d\u044b\u0439 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c \u043c\u044b \u0432 \u044d\u0442\u043e\u0439 \u043d\u043e\u0442\u0430\u0446\u0438\u0438 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c.<\/p>\n<p>\u041d\u043e \u0441\u0430\u043c\u0430 \u0438\u0434\u0435\u044f \u0441\u043e\u043a\u0440\u0430\u0449\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u043d\u0435 \u0442\u0430\u043a \u0443\u0436\u0435 \u0431\u0435\u0441\u043f\u043e\u043b\u0435\u0437\u043d\u0430. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440.<\/p>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u043f\u0440\u043e\u0448\u043b\u043e\u043c \u0430\u0431\u0437\u0430\u0446\u0435 \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 <em>x<\/em> \u0438 <em>y<\/em> \u0434\u043b\u0438\u043d\u043e\u0439 <em>n<\/em> \u0431\u0438\u0442.<\/p>\n<p>\u201c\u0420\u0430\u0437\u0440\u0435\u0436\u0435\u043c\u201d \u044d\u0442\u0438 \u0447\u0438\u0441\u043b\u0430 \u043f\u043e\u043f\u043e\u043b\u0430\u043c \u043d\u0430 \u0441\u0442\u0430\u0440\u0448\u0443\u044e (\u043b\u0435\u0432\u0443\u044e) \u0447\u0430\u0441\u0442\u044c \u0434\u043b\u0438\u043d\u043e\u0439 <em>n\/2<\/em> \u0431\u0438\u0442\u0430 \u0438 \u043c\u043b\u0430\u0434\u0448\u0443\u044e (\u043f\u0440\u0430\u0432\u0443\u044e) \u0447\u0430\u0441\u0442\u044c \u0434\u043b\u0438\u043d\u043e\u0439 <em>n\/2<\/em> \u0431\u0438\u0442\u0430. \u041e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u043c \u043d\u043e\u0432\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440,  <\/p>\n<p>\u0422\u043e\u0433\u0434\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <em>xy<\/em> \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c, \u043a\u0430\u043a  <\/p>\n<p>\u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u043c\u044b \u0431\u0443\u0434\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 <em>xy<\/em>, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u0444\u043e\u0440\u043c\u0443\u043b\u0443 \u0432 \u043f\u0440\u0430\u0432\u043e\u0439 \u0447\u0430\u0441\u0442\u0438? \u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 <em>2<sup>n<\/sup><\/em> \u044d\u0442\u043e \u0432\u0441\u0435\u0433\u043e \u043b\u0438\u0448\u044c \u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433, \u044d\u0442\u043e \u0434\u0430\u0436\u0435 \u0437\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0435 \u0441\u0447\u0438\u0442\u0430\u0435\u043c, \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f. \u0422\u0440\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f <em>O(n)<\/em>. \u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f:\u00a0 <\/p>\n<p>\u041d\u043e, \u0437\u0430\u043c\u0435\u0442\u0438\u043c, \u0447\u0442\u043e \u044d\u0442\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0442\u0435\u043f\u0435\u0440\u044c \u043d\u0435 \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0434\u043b\u0438\u043d\u043e\u044e <em>n<\/em> \u0431\u0438\u0442, \u0430 \u0441 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u0434\u043b\u0438\u043d\u043e\u044e <em>n\/2<\/em> \u0431\u0438\u0442. \u041f\u0440\u0430\u0432\u0434\u0430, \u0441 \u0434\u0440\u0443\u0433\u043e\u0439 \u0441\u0442\u043e\u0440\u043e\u043d\u044b, \u0432\u043c\u0435\u0441\u0442\u043e \u043e\u0434\u043d\u043e\u0439 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0438\u0445 \u0441\u0442\u0430\u043b\u043e \u0447\u0435\u0442\u044b\u0440\u0435.\u00a0<\/p>\n<p>\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u0439 1 \u0431\u0438\u0442 \u0442\u0440\u0438\u0432\u0438\u0430\u043b\u044c\u043d\u043e, \u044d\u0442\u043e \u043b\u043e\u0433\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f AND \u0438 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u0437\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u043e\u0439 <em>n<\/em>=2 \u0431\u0438\u0442, \u0442\u043e \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b, \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u043b\u0438\u043d\u043e\u044e 1 \u0431\u0438\u0442.\u00a0<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043d\u0430\u0434\u043e \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0438\u0442\u044c \u0434\u0432\u0430 \u0447\u0438\u0441\u043b\u0430 \u0434\u043b\u0438\u043d\u043e\u044e <em>n<\/em>=4 \u0431\u0438\u0442, \u0442\u043e \u043c\u044b \u0435\u0433\u043e \u043c\u043e\u0436\u0435\u043c \u044d\u0442\u0443 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0447\u0438\u0441\u0435\u043b, \u043a\u0430\u0436\u0434\u043e\u0435 \u0434\u043b\u0438\u043d\u043e\u044e 2 \u0431\u0438\u0442, \u0432 \u0441\u0432\u043e\u044e \u043e\u0447\u0435\u0440\u0435\u0434\u044c, \u044d\u0442\u043e \u0437\u0430\u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f 16 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u044e 1 \u0431\u0438\u0442.\u00a0<\/p>\n<p>\u041d\u0430\u043f\u0440\u0430\u0448\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c<\/p>\n<p>\u0415\u0441\u043b\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u044e <em>n<\/em> \u0431\u0438\u0442 \u044d\u0442\u0438\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c, \u043a\u0430\u043a <em>T(n)<\/em>, \u0442\u043e \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f, \u043c\u044b \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0447\u0435\u0442\u044b\u0440\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f <em>T(n\/2)<\/em> \u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0432\u0438\u0433\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 <em>O(n)<\/em>.<\/p>\n<p>\u041d\u0435 \u0431\u0443\u0434\u0435\u043c \u0437\u0430\u043d\u0438\u043c\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435\u043c \u044d\u0442\u043e\u0433\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435 \u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u0433\u043e, \u043e\u0442\u0432\u0435\u0442 \u0431\u0443\u0434\u0435\u0442 <em>T(n)=O(n<sup>2<\/sup>)<\/em><\/p>\n<p>\u0422\u043e \u0435\u0441\u0442\u044c \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u043b\u0438 \u043d\u043e\u0432\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b, \u0438 \u043e\u043d \u0434\u0430\u0435\u0442 \u0442\u0430\u043a\u0443\u044e \u0436\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u044c, \u043a\u0430\u043a \u0438 \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d. \u041e\u0431\u0438\u0434\u043d\u043e!<\/p>\n<p>\u0418 \u0442\u0443\u0442 \u0442\u043e \u043d\u0430\u043c \u0438 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442 \u043d\u0430 \u043f\u043e\u043c\u043e\u0449\u044c \u0413\u0430\u0443\u0441\u0441. \u0427\u0442\u043e \u0435\u0441\u043b\u0438 \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 (1) \u043c\u043e\u0436\u043d\u043e \u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u0447\u0435\u0442\u044b\u0440\u0435, \u0430 \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f. \u041a\u043e\u043d\u0435\u0447\u043d\u043e, \u0432\u0435\u0434\u044c<\/p>\n<p>\u0418 \u043d\u0430\u043c \u043d\u0430\u0434\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u044c \u0432\u0441\u0435\u0433\u043e \u0442\u0440\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f <em>n\/2<\/em>-\u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b  <\/p>\n<p>\u0410 \u0432\u0441\u0435 \u043e\u0441\u0442\u0430\u043b\u044c\u043d\u043e\u0435 &#8212; \u044d\u0442\u043e \u043e\u043f\u044f\u0442\u044c \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0432\u0438\u0433\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0437\u0430 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435 \u0432\u0440\u0435\u043c\u044f.<\/p>\n<p>\u0421\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u043e\u0433\u043e \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u043c \u0441\u043f\u043e\u0441\u043e\u0431\u043e\u043c:<\/p>\n<p>\u0420\u0435\u0448\u0438\u043c \u044d\u0442\u043e \u0443\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435, \u043f\u043e\u0441\u0442\u0440\u043e\u0438\u0432 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0435 \u0434\u0435\u0440\u0435\u0432\u043e. \u041d\u0430 \u0432\u0435\u0440\u0448\u0438\u043d\u0435 \u044d\u0442\u043e\u0433\u043e \u0434\u0435\u0440\u0435\u0432\u0430, \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b <em>xy<\/em> \u0434\u043b\u0438\u043d\u044b <em>n<\/em> \u0431\u0438\u0442.<\/p>\n<p>\u0423\u0440\u043e\u0432\u043d\u0435\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438 \u043d\u0438\u0436\u0435 \u0434\u0435\u0440\u0435\u0432\u043e \u0440\u0430\u0441\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u043d\u0430 \u0442\u0440\u0438 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u044b <em>n\/2<\/em><\/p>\n<p>\u0421 \u043a\u0430\u0436\u0434\u044b\u043c \u043d\u043e\u0432\u044b\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0442\u0432\u0435\u0439 \u0434\u0435\u0440\u0435\u0432\u0430 \u0443\u0442\u0440\u0430\u0438\u0432\u0430\u0435\u0442\u0441\u044f, \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0434\u043b\u0438\u043d\u0430 \u0432 \u0431\u0438\u0442\u0430\u0445 \u0443\u043c\u043d\u043e\u0436\u0430\u0435\u043c\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u0435\u043b\u0438\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u0430.<\/p>\n<p>\u041d\u0430 <em>k<\/em>-\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u043c\u044b \u0438\u043c\u0435\u0435\u043c <em>3<sup>k<\/sup><\/em> \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f, \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443 <em>n\/2<sup>k<\/sup><\/em> \u0431\u0438\u0442. \u041d\u0430 <em>k<\/em>-\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u0442 \u0435\u0449\u0435 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0435 \u0432\u0440\u0435\u043c\u044f, \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044f \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0432\u0438\u0433\u0430 \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u044e <em>n\/2<sup>k<\/sup><\/em> \u0431\u0438\u0442, \u0442.\u0435. \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e O(<em>n\/2<sup>k<\/sup><\/em>)<\/p>\n<p>\u041e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u043e\u044e <em>n\/2<sup>k<\/sup><\/em> \u043c\u044b \u043d\u0435 \u0443\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c, \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u0430 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 <em>k+1<\/em> \u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438 \u0438 \u043d\u0430 \u043d\u0430\u0448 \u0443\u0440\u043e\u0432\u0435\u043d\u044c \u0443\u0436\u0435 \u043f\u0435\u0440\u0435\u0434\u0430\u043d \u043e\u0442\u0432\u0435\u0442. \u041c\u044b \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043d\u0430 <em>k<\/em>-\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e <em>3<sup>k<\/sup><\/em> \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u043b\u043e\u0436\u0435\u043d\u0438\u044f \u0438 \u0441\u0434\u0432\u0438\u0433\u0430, \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 O(<em>n\/2<sup>k<\/sup><\/em>) \u0438 \u043f\u0435\u0440\u0435\u0434\u0430\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u044b \u0443\u0440\u043e\u0432\u043d\u044e \u0432\u044b\u0448\u0435.<\/p>\n<p>\u0422.\u0435. \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0430 <em>k<\/em>-\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0438 \u044d\u0442\u043e<\/p>\n<p>\u041f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u043e \u0443\u0440\u043e\u0432\u043d\u044f\u043c \u0434\u0435\u0440\u0435\u0432\u0430, \u044d\u0442\u043e \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u044f \u0441 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u043c 3\/2<\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u0432\u0435\u0440\u0445\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435 <em>k<\/em>=0 \u043f\u043e \u044d\u0442\u043e\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u043e\u0441\u0442\u043e <em>O(n)<\/em><\/p>\n<p>\u041d\u0430 \u0441\u0430\u043c\u043e\u043c \u043d\u0438\u0436\u043d\u0435\u043c \u0443\u0440\u043e\u0432\u043d\u0435 <em>k=log<sub>2<\/sub>(n)<\/em> \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u043e\u0432\u0435\u0441\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439\u00a0<\/p>\n<p>\u0410 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0445\u043d\u0438\u043c \u0438 \u043d\u0438\u0436\u043d\u0438\u043c \u0443\u0440\u043e\u0432\u043d\u0435\u043c \u043c\u044b \u0438\u043c\u0435\u0435\u043c \u043d\u0435\u0447\u0442\u043e \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u043e\u0435 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435\u043c \u043d\u0430 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u044c <em>3\/2<\/em> \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0442\u043e \u0440\u0430\u0437.<\/p>\n<p>\u0410 \u0437\u043d\u0430\u0447\u0438\u0442, \u043e\u0431\u0449\u0430\u044f \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u044d\u0442\u043e \u0441\u0443\u043c\u043c\u0430 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0435\u0439 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u0443\u0440\u043e\u0432\u043d\u0435 \u0434\u0435\u0440\u0435\u0432\u0430, \u0438\u043b\u0438, \u043a\u0430\u043a \u043c\u044b \u0432\u0438\u0434\u0438\u043c, \u044d\u0442\u043e \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u0443\u043c\u043c\u0430 \u0433\u0435\u043e\u043c\u0435\u0442\u0440\u0438\u0447\u0435\u0441\u043a\u043e\u0439 \u043f\u0440\u043e\u0433\u0440\u0435\u0441\u0441\u0438\u0438 \u0441 \u043c\u043d\u043e\u0436\u0438\u0442\u0435\u043b\u0435\u043c <em>3\/2<\/em> \u0438 \u043f\u0435\u0440\u0432\u044b\u043c \u0447\u043b\u0435\u043d\u043e\u043c <em>O(n)<\/em><\/p>\n<p>\u041e\u043f\u0443\u0441\u043a\u0430\u0435\u043c \u0432\u044b\u0447\u0438\u0442\u0430\u043d\u0438\u0435 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u044b \u0438 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u043e\u043d\u0441\u0442\u0430\u043d\u0442\u0443, \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0442\u043e\u0433\u043e\u0432\u0443\u044e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f.  <\/p>\n<p>\u0418\u0442\u0430\u043a \u043d\u0430\u0448 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435\u0441\u043e\u043c\u043d\u0435\u043d\u043d\u043e \u0431\u043e\u043b\u0435\u0435 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439, \u0447\u0435\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u201c\u0441\u0442\u043e\u043b\u0431\u0438\u043a\u043e\u043c\u201d \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e <em>O(n<sup>2<\/sup>).<\/em><\/p>\n<p>\u0414\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u041a\u0430\u0440\u0430\u0446\u0443\u0431\u044b. \u0412 \u043a\u043e\u043d\u0446\u0435 1950-\u044b\u0445 \u0410\u043d\u0434\u0440\u0435\u0439 \u041a\u043e\u043b\u043c\u043e\u0433\u043e\u0440\u043e\u0432 \u0432\u044b\u0434\u0432\u0438\u043d\u0443\u043b \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443 \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 &#171;\u0432 \u0441\u0442\u043e\u043b\u0431\u0438\u043a&#187; \u0441\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c\u044e <em>O(n<sup>2<\/sup>)<\/em> \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0430\u0441\u0438\u043c\u043f\u0442\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u0438 \u043e\u043f\u0442\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0447\u0438\u0441\u0435\u043b, \u0447\u0442\u043e \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442, \u0447\u0442\u043e \u043b\u044e\u0431\u043e\u0439 \u0434\u0440\u0443\u0433\u043e\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c, \u0440\u0435\u0448\u0430\u044e\u0449\u0438\u0439 \u044d\u0442\u0443 \u0437\u0430\u0434\u0430\u0447\u0443 \u043f\u043e\u0442\u0440\u0435\u0431\u0443\u0435\u0442 <em>\u03a9(n<sup>2<\/sup>)<\/em> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u0440\u043d\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439. \u0412 1960-\u043e\u043c, \u041a\u043e\u043b\u043c\u043e\u0433\u043e\u0440\u043e\u0432 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b \u0441\u0435\u043c\u0438\u043d\u0430\u0440 \u043f\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u043c \u043f\u0440\u043e\u0431\u043b\u0435\u043c\u0430\u043c \u043a\u0438\u0431\u0435\u0440\u043d\u0435\u0442\u0438\u043a\u0438 \u0432 \u041c\u0413\u0423, \u0433\u0434\u0435 \u043e\u043d \u043e\u0437\u0432\u0443\u0447\u0438\u043b \u044d\u0442\u0443 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443, \u0438 \u0440\u044f\u0434 \u0434\u0440\u0443\u0433\u0438\u0445 \u0437\u0430\u0434\u0430\u0447 \u043f\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432. \u0412 \u0442\u0435\u0447\u0435\u043d\u0438\u0435 \u043d\u0435\u0434\u0435\u043b\u0438, 23-\u043b\u0435\u0442\u043d\u0438\u0439 \u0441\u0442\u0443\u0434\u0435\u043d\u0442 \u0410\u043d\u0430\u0442\u043e\u043b\u0438\u0439 \u041a\u0430\u0440\u0430\u0446\u0443\u0431\u0430 \u043d\u0430\u0448\u0435\u043b \u0434\u0430\u043d\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c  <em>O(n<sup>log(3)<\/sup>)<\/em> \u0438, \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043e\u043f\u0440\u043e\u0432\u0435\u0440\u0433 \u0433\u0438\u043f\u043e\u0442\u0435\u0437\u0443. \u041a\u043e\u043b\u043c\u043e\u0433\u043e\u0440\u043e\u0432 \u0431\u044b\u043b \u0432\u043e\u0441\u0445\u0438\u0449\u0435\u043d \u043e\u0442\u043a\u0440\u044b\u0442\u0438\u0435\u043c. \u041e\u043d \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u0430\u043b \u043e\u0431 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0434\u0435\u043d\u044c \u043d\u0430 \u0441\u0435\u043c\u0438\u043d\u0430\u0440\u0435. \u0421 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u041a\u0430\u0440\u0430\u0446\u0443\u0431\u044b \u041a\u043e\u043b\u043c\u043e\u0433\u043e\u0440\u043e\u0432 \u043f\u0440\u043e\u0432\u0435\u043b \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u043b\u0435\u043a\u0446\u0438\u0439 \u0438 \u0432\u044b\u0441\u0442\u0443\u043f\u043b\u0435\u043d\u0438\u0439 \u043d\u0430 \u043a\u043e\u043d\u0444\u0435\u0440\u0435\u043d\u0446\u0438\u044f\u0445 \u043f\u043e \u0432\u0441\u0435\u043c\u0443 \u043c\u0438\u0440\u0443. \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0431\u044b\u043b \u043e\u043f\u0443\u0431\u043b\u0438\u043a\u043e\u0432\u0430\u043d \u0432 1962 \u0433\u043e\u0434\u0443: \u042e. \u041f. \u041e\u0444\u043c\u0430\u043d, \u0410. \u0410. \u041a\u0430\u0440\u0430\u0446\u0443\u0431\u0430, \u00ab\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u043d\u043e\u0433\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043d\u0430 \u0430\u0432\u0442\u043e\u043c\u0430\u0442\u0430\u0445\u00bb \u0414\u043e\u043a\u043b\u0430\u0434\u044b \u0410\u041d \u0421\u0421\u0421\u0420. \u2014 1962 \u2014 \u0422. 145. \u2014 \u0421. 293\u2014294.<\/p>\n<p>\u041f\u043e\u0434\u0432\u0435\u0434\u0435\u043c \u0438\u0442\u043e\u0433. \u0427\u0442\u043e \u043c\u044b \u0441\u0434\u0435\u043b\u0430\u043b\u0438, \u0447\u0442\u043e\u0431\u044b \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c?<\/p>\n<p>\u041c\u044b \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u043b\u0438 \u0437\u0430\u0434\u0430\u0447\u0443 \u0434\u043b\u0438\u043d\u044b <em>n<\/em> \u043d\u0430 3 \u0437\u0430\u0434\u0430\u0447\u0438\u00a0 \u0434\u043b\u0438\u043d\u044b <em>n\/2<\/em> \u0438 \u0432\u0434\u0440\u0443\u0433, \u043e\u0431\u043d\u0430\u0440\u0443\u0436\u0438\u043b\u0438, \u0447\u0442\u043e \u044d\u0442\u043e \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u0435\u0435!<\/p>\n<p>\u0410 \u043c\u043e\u0436\u043d\u043e \u043b\u0438 \u0442\u0430\u043a \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0438 \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438, \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u043c \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u044f?<\/p>\n<p>\u0414\u0430, \u043c\u043e\u0436\u043d\u043e!<\/p>\n<p>\u0412 \u044d\u0442\u043e\u043c \u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u00ab\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439\u00bb \u0443\u043b\u0443\u0447\u0448\u0435\u043d\u0438\u044f \u0440\u0430\u0431\u043e\u0442\u044b \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0432\u00a0\u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u043c\u044b \u043c\u043e\u0436\u0435\u043c \u043e\u0431\u043e\u0431\u0449\u0438\u0442\u044c \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043f\u044b\u0442\u0430\u0442\u044c\u0441\u044f \u043f\u043e\u043d\u044f\u0442\u044c, \u043a\u043e\u0433\u0434\u0430 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u00ab\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439\u00bb \u0434\u0430\u0435\u0442 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432\u00a0\u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0438 \u0441\u00a0\u0431\u0430\u0437\u043e\u0432\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0435\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430, \u0430\u00a0\u043a\u043e\u0433\u0434\u0430 \u043d\u0435\u0442. \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u0434\u0440\u0443\u0433\u0438\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432, \u0433\u0434\u0435 \u043f\u0440\u0438\u043d\u0446\u0438\u043f \u00ab\u0420\u0430\u0437\u0434\u0435\u043b\u044f\u0439 \u0438 \u0432\u043b\u0430\u0441\u0442\u0432\u0443\u0439\u00bb \u0434\u0430\u043b \u043e\u0449\u0443\u0442\u0438\u043c\u044b\u0439 \u0432\u044b\u0438\u0433\u0440\u044b\u0448 \u0432 \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0441\u0442\u0438.<\/p>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/habr.com\/ru\/articles\/742404\/\" rel=\"noopener noreferrer nofollow\">\u0432\u0442\u043e\u0440\u0443\u044e \u0447\u0430\u0441\u0442\u044c<\/a><\/p>\n<\/p>\n<\/div>\n<\/div>\n<\/div>\n<p><!----><!----><\/div>\n<p><!----><!----><br \/> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habr.com\/ru\/articles\/742308\/\"> https:\/\/habr.com\/ru\/articles\/742308\/<\/a><br \/><\/br><\/br><\/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-413420","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/413420","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=413420"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/413420\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=413420"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=413420"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=413420"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}