{"id":281467,"date":"2016-11-24T09:45:04","date_gmt":"2016-11-24T06:45:04","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=281467"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=281467","title":{"rendered":"\u0417\u0430\u0434\u0430\u0447\u0430 \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u0430 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u041b\u0438\u0442\u0442\u043b\u0430 \u043d\u0430 C++"},"content":{"rendered":"<p>\u041e\u0431\u0443\u0447\u0430\u044f\u0441\u044c \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0435, \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412\u043e\u0442, \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u043b\u0443\u0433\u043e\u0434\u0438\u044f, \u0441\u0435\u0441\u0441\u0438\u044f \u043d\u0430 \u043d\u043e\u0441\u0443, \u043d\u0430\u0447\u0430\u043b\u043e \u0432\u044b\u0434\u0430\u0447\u0438 \u043a\u0443\u0440\u0441\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0438 \u043c\u043d\u0435 \u043f\u043e\u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u0438\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u0442\u044c \u0442\u0435\u043c, \u043a\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u041b\u0438\u0442\u0442\u043b\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u0430. \u0418\u0442\u0430\u043a \u043d\u0430\u0447\u043d\u0435\u043c. <\/p>\n<p>  \u041a\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440? \u041a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440 \u2014 \u044d\u0442\u043e \u0440\u0430\u0437\u044a\u0435\u0437\u0434\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u044b\u0439 \u0430\u0433\u0435\u043d\u0442 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0444\u0438\u0440\u043c\u044b, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044f\u043c \u0442\u043e\u0432\u0430\u0440\u044b \u043f\u043e \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u043c \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c. \u0415\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0431\u044a\u0435\u0437\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0443\u043d\u043a\u0442\u044b \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u0435 \u043f\u043e\u0431\u044b\u0432\u0430\u0432 \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0434\u0432\u0430\u0436\u0434\u044b \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u0447\u043a\u0443 \u0441\u0442\u0430\u0440\u0442\u0430.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ef4\/c68\/155\/ef4c6815518d4d6aa5ea2073b56e8291.jpg\" alt=\"image\" \/><\/div>\n<p>  <a name=\"habracut\"><\/a>  <\/p>\n<h4><b>\u041c\u0435\u0442\u043e\u0434 \u041b\u0438\u0442\u0442\u043b\u0430<\/b><\/h4>\n<p>  \u0426\u0435\u043b\u044c\u044e \u0434\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0435\u0442\u043e\u0434\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u043e\u0438\u0441\u043a \u0433\u0430\u043c\u0438\u043b\u044c\u0442\u043e\u043d\u043e\u0432\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430 \u0441 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u044c\u044e \u0432 \u0433\u0440\u0430\u0444\u0435. \u0427\u0442\u043e \u0431\u044b \u043d\u0430\u0439\u0442\u0438 \u0435\u0433\u043e, \u043d\u0443\u0436\u043d\u043e \u043f\u0440\u0438\u0434\u0435\u0440\u0436\u0438\u0432\u0430\u0442\u044c\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f\u043c:<\/p>\n<ol>\n<li>\u0412 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438 \u043d\u0430\u0439\u0434\u0435\u043c \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0438 \u0432\u044b\u0447\u0442\u0435\u043c \u0435\u0433\u043e \u0438\u0437 \u0432\u0441\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u0438. \u0421\u0434\u0435\u043b\u0430\u0435\u043c \u044d\u0442\u043e \u0438 \u0434\u043b\u044f \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432, \u043d\u0435 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0449\u0438\u0445 \u043d\u0443\u043b\u044f. \u041f\u043e\u043b\u0443\u0447\u0438\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u0442\u043e\u0438\u043c\u043e\u0441\u0442\u0438, \u043a\u0430\u0436\u0434\u0430\u044f \u0441\u0442\u0440\u043e\u043a\u0430 \u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0441\u043e\u0434\u0435\u0440\u0436\u0430\u0442 \u0445\u043e\u0442\u044f \u0431\u044b \u043e\u0434\u0438\u043d \u043d\u0443\u043b\u0435\u0432\u043e\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442.<\/li>\n<li>\u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442 k, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0440\u0430\u0432\u0435\u043d \u0441\u0443\u043c\u043c\u0435 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u0438 \u0441\u0442\u0440\u043e\u043a\u0438 \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u043b\u044f. \u0412\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043d\u0443\u043b\u044c \u0441 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u043a\u043e\u044d\u0444\u0444\u0438\u0446\u0438\u0435\u043d\u0442\u043e\u043c (\u0435\u0441\u043b\u0438 \u0442\u0430\u043a\u043e\u0432\u044b\u0445 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u044b\u0431\u0438\u0440\u0430\u0435\u043c \u043b\u044e\u0431\u043e\u0439 \u0438\u0437 \u043d\u0438\u0445). \u0412\u043d\u043e\u0441\u0438\u043c \u0432 \u0433\u0430\u043c\u0438\u043b\u044c\u0442\u043e\u043d\u043e\u0432 \u043a\u043e\u043d\u0442\u0443\u0440 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0443\u044e \u0434\u0443\u0433\u0443.<\/li>\n<li>\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0441\u0442\u043e\u043b\u0431\u0435\u0446, \u043d\u0430 \u043f\u0435\u0440\u0435\u0441\u0435\u0447\u0435\u043d\u0438\u0438 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0439 \u043d\u0430\u043c\u0438 \u043d\u0443\u043b\u044c.<\/li>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0433\u0440\u0430\u0444 \u043d\u0430 \u043d\u0430\u043b\u0438\u0447\u0438\u0435 \u0442\u043e\u0447\u0435\u043a \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430, \u0435\u0441\u043b\u0438 \u0435\u0441\u0442\u044c \u0442\u0430\u043a\u043e\u0432\u044b\u0435, \u0442\u043e \u043c\u0435\u043d\u044f\u0435\u043c \u0438\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435. \u041f\u043e\u0432\u0442\u043e\u0440\u044f\u0435\u043c \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u0435 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u044f \u043f\u043e\u043a\u0430 \u043d\u0435 \u043e\u0441\u0442\u0430\u043d\u0435\u0442\u0441\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u043f\u043e\u0440\u044f\u0434\u043a\u0430 2.<\/li>\n<li>\u0412\u043d\u043e\u0441\u0438\u043c \u0432 \u0433\u0430\u043c\u0438\u043b\u044c\u0442\u043e\u043d\u043e\u0432 \u043a\u043e\u043d\u0442\u0443\u0440 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u044e\u0449\u0438\u0435 \u0434\u0443\u0433\u0438. \u041f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0438\u0441\u043a\u043e\u043c\u044b\u0439 \u0446\u0438\u043a\u043b.<\/li>\n<\/ol>\n<p>  <\/p>\n<h4><b>\u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f<\/b><\/h4>\n<p>  \u0414\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0440\u0430\u0441\u0448\u0438\u0440\u0435\u043d\u0438\u044f \u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0434\u0440\u0443\u0433\u0438\u043c\u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430\u043c\u0438, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 Algorithm:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Algorithm<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">\/\/Algorithm.h class Algorithm { public: \tchar* name = &quot;Algorithm&quot;; \/\/ \u041d\u0430\u0437\u0432\u0430\u043d\u0438\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \tstd::vector&lt;std::vector&lt;int&gt;&gt; data; \/\/ \u041c\u0430\u0441\u0441\u0438\u0432 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 (\u043c\u0430\u0442\u0440\u0438\u0446\u0430) \tAlgorithm(); \tAlgorithm(std::vector&lt;std::vector&lt;int&gt;&gt;); \tAlgorithm(char*); \tbool LoadData(std::vector&lt;std::vector&lt;int&gt;&gt;); \tbool LoadData(char*); \tvirtual void Run(); \/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u0437\u0430\u043f\u0443\u0441\u043a\u0430 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 protected: \tint GetStrCount(std::ifstream&); \/\/ \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0432 \u0444\u0430\u0439\u043b\u0435 \tint GetColCount(std::ifstream&); \/\/ \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u0432 \u0444\u0430\u0439\u043b\u0435 \tvirtual bool validateData(); \/\/ \u041c\u0435\u0442\u043e\u0434 \u0434\u043b\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0435. \u0412\u044b\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0435\u0440\u0435\u0434 Run() }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u041a\u0430\u043a \u0432\u0438\u0434\u043d\u043e \u0432\u044b\u0448\u0435, \u0437\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0443\u0442 \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u043d\u044b \u043c\u0435\u0442\u043e\u0434\u044b \u0434\u043b\u044f \u0437\u0430\u0433\u0440\u0443\u0437\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0438 \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0418\u0445 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u043c\u043e\u0442\u0440\u0435\u0442\u044c \u0432 \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u0438.<\/p>\n<p>  \u0414\u0430\u043b\u0435\u0435, \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u043a\u043b\u0430\u0441\u0441 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0449\u0435\u0433\u043e \u043d\u0430\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430. \u0412 \u043d\u0430\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 LittleAlgorithm.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">LittleAlgorithm<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">class LittleAlgorithm : public Algorithm { public: \tvector&lt;pair&lt;int,int&gt;&gt; result; \/\/ \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442. \u0417\u0434\u0435\u0441\u044c \u0431\u0443\u0434\u0435\u0442 \u0445\u0440\u0430\u043d\u0438\u0442\u044c\u0441\u044f \u0438\u0441\u043a\u043e\u043c\u044b\u0439 \u0446\u0438\u043a\u043b \tLittleAlgorithm(); \tLittleAlgorithm(vector&lt;vector&lt;int&gt;&gt;); \tLittleAlgorithm(char*); \tvirtual void Run(); private: \tenum check{Row, Col}; \tint getMin(vector&lt;vector&lt;int&gt;&gt;, int, check); \/\/ \u041f\u043e\u0438\u0441\u043a \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0441\u0442\u043e\u043b\u0431\u0446\u0430\/\u0441\u0442\u0440\u043e\u043a\u0438 \tvoid matrixProcedure(vector&lt;vector&lt;int&gt;&gt;); \/\/ \u041c\u0435\u0442\u043e\u0434 \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0438\u0434\u0435\u0442 \u043f\u043e\u0438\u0441\u043a \u0446\u0438\u043a\u043b\u0430 \tvoid showMatrix(vector&lt;vector&lt;int&gt;&gt;); \/\/ \u0412\u044b\u0432\u043e\u0434 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \tint getResultSum(); \/\/ \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u043d\u0438\u0435 \u0441\u0443\u043c\u043c\u044b \u0432\u0441\u0435\u0445 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u0434\u0443\u0433 \tvirtual bool validateData();  }; <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0420\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u043c\u0435\u0442\u043e\u0434\u043e\u0432:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">Other<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">void LittleAlgorithm::Run() { \tname = &quot;Little algorithm&quot;; \tAlgorithm::Run();  \tmatrixProcedure(vector&lt;vector&lt;int&gt;&gt;(data)); } int LittleAlgorithm::getMin(vector&lt;vector&lt;int&gt;&gt; matrix, int sel, check pos) { \tint min = INT32_MAX; \tfor (int i = 0; i &lt; matrix[sel].size() - 1; i++) \t\tswitch (pos) \t\t{ \t\tcase LittleAlgorithm::Row: \t\t\tif (min &gt; matrix[sel][i]) \t\t\t\tmin = matrix[sel][i]; \t\t\tbreak; \t\tcase LittleAlgorithm::Col: \t\t\tif (min &gt; matrix[i][sel]) \t\t\t\tmin = matrix[i][sel]; \t\t\tbreak; \t\t} \treturn min; } void LittleAlgorithm::showMatrix(vector&lt;vector&lt;int&gt;&gt; temp) { \tstd::cout &lt;&lt; endl; \tstd::cout &lt;&lt; &quot;\\t&quot;; \tfor (int i = 0; i &lt; temp[temp.size() - 1].size() - 1; i++) { \t\tstd::cout &lt;&lt; temp[temp.size() - 1][i] &lt;&lt; &quot;\\t&quot;; \t} \tstd::cout &lt;&lt; endl; \tstd::cout &lt;&lt; &quot;\\t&quot;; \tfor (int i = 0; i &lt; temp[0].size(); i++) \t\tfor (int j = 0; j&lt;6; j++) std::cout &lt;&lt; &quot;_&quot;; \tstd::cout &lt;&lt; endl &lt;&lt;endl; \tfor (int i = 0; i &lt; temp.size() - 1; i++) { \t\tstd::cout &lt;&lt; temp[i][temp.size() - 1] &lt;&lt; &quot; | &quot; &lt;&lt; &quot;\\t&quot;; \t\tfor (int j = 0; j &lt; temp[i].size() - 1; j++) \t\t\tif(temp[i][j] != INT32_MAX && j != temp.size() - 1)std::cout &lt;&lt; temp[i][j] &lt;&lt; &quot;\\t&quot;; \t\t\telse std::cout &lt;&lt; &quot;inf&quot; &lt;&lt; &quot;\\t&quot;; \t\tstd::cout &lt;&lt; endl; \t} \tstd::cout &lt;&lt; endl &lt;&lt; endl; } int LittleAlgorithm::getResultSum() { \tint sum = 0; \tfor (int i = 0; i &lt; result.size(); i++) \t\tsum += data[result[i].first - 1][result[i].second - 1]; \treturn sum; } bool LittleAlgorithm::validateData() { \t\/\/\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432 \u043d\u0430\u0448\u0443 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0438 \u0441\u0442\u0440\u043e\u043a\u0443 \u0441 \u043d\u0443\u043c\u0435\u0440\u0430\u0446\u0438\u0435\u0439 \u0434\u043b\u044f \u043e\u0442\u0441\u043b\u0435\u0436\u0438\u0432\u0430\u043d\u0438\u044f \u0443\u0434\u0430\u043b\u044f\u0435\u043c\u044b\u0445 \u0440\u0435\u0431\u0435\u0440 \tfor (int i = 0; i &lt; data.size(); i++) \t\tfor (int j = 0; j &lt; data[i].size(); j++) \t\t\tif (data[i][j] == 0) \t\t\t\tdata[i][j] = INT32_MAX;  \tvector&lt;vector&lt;int&gt;&gt; temp(data); \tfor (int i = 0; i &lt; data.size(); i++) \t\tdata[i].push_back(i + 1); \tvector&lt;int&gt; numeration; \tfor (int i = 0; i &lt; data[0].size(); i++) \t\tnumeration.push_back(i + 1); \tdata.push_back(numeration);  \treturn true; } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  \u0410 \u0432\u043e\u0442 \u0438 \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0433\u043e\u0432\u043e\u0440\u044f \u0441\u0430\u043c \u043c\u0435\u0442\u043e\u0434, \u0440\u0435\u0430\u043b\u0438\u0437\u0443\u044e\u0449\u0438\u0439 \u043c\u0435\u0442\u043e\u0434 \u041b\u0438\u0442\u0442\u043b\u0430:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">matrixProcedure<\/b><\/p>\n<div class=\"spoiler_text\">\n<pre><code class=\"cpp\">void LittleAlgorithm::matrixProcedure(vector&lt;vector&lt;int&gt;&gt; matrix) { \t\/\/\u041e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u0442\u043e\u0447\u043a\u0443 \u0432\u043e\u0437\u0432\u0440\u0430\u0442\u0430 \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0435 \u0440\u0435\u0431\u0440\u043e \tif (matrix.size() - 1 &gt; 2){ \t\tvector&lt;int&gt; vertexes; \t\tfor (int i = 0; i &lt; result.size(); i++) { \t\t\tvertexes.push_back(result[i].first); \t\t\tvertexes.push_back(result[i].second); \t\t} \t\tfor (int i = 0; i &lt; vertexes.size(); i++) { \t\t\tpair&lt;int, int&gt; elem(INT32_MAX, INT32_MAX), elem1(INT32_MAX, INT32_MAX); \t\t\tfor (int j = 0; j &lt; vertexes.size(); j++) { \t\t\t\tif (vertexes[i] != vertexes[j]) { \t\t\t\t\tfor (int k = 0; k &lt; matrix[matrix.size() - 1].size() - 1; k++) { \t\t\t\t\t\tif (vertexes[i] == matrix[k][matrix[k].size() - 1]) elem.first = k; \t\t\t\t\t\tif (vertexes[j] == matrix[k][matrix[k].size() - 1]) elem1.first = k; \t\t\t\t\t} \t\t\t\t\tfor (int k = 0; k &lt; matrix.size() - 1; k++) { \t\t\t\t\t\tif (vertexes[i] == matrix[matrix.size() - 1][k]) elem.second = k; \t\t\t\t\t\tif (vertexes[j] == matrix[matrix.size() - 1][k]) elem1.second = k; \t\t\t\t\t} \t\t\t\t} \t\t\t} \t\t\tfor (int i = 0; i &lt; matrix.size() - 1; i++) \t\t\t\tfor (int j = 0; j&lt;matrix.size() - 1; j++) \t\t\t\t\tif (i == elem1.first && j == elem1.second) \t\t\t\t\t\tmatrix[elem1.first][elem1.second] = INT32_MAX; \t\t\tfor (int i = 0; i &lt; matrix.size() - 1; i++) \t\t\t\tfor (int j = 0; j &lt; matrix.size() - 1; j++) \t\t\t\t\tif (i == elem.first && j == elem.second) \t\t\t\t\t\tmatrix[elem.first][elem.second] = INT32_MAX; \t\t} \t}  \t\/\/\u0412\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \tfor (int i = 0; i &lt; matrix.size() - 1; i++) { \t\tint min = 0; \t\tif ((min = getMin(matrix, i, check::Row)) == INT32_MAX) { \t\t\tshowMatrix(matrix); \t\t\tstd::cout &lt;&lt; endl &lt;&lt; &quot;Bad road&quot; &lt;&lt; endl; \t\t\treturn; \t\t} \t\tif ((min = getMin(matrix, i, check::Row)) != 0) \t\t\tfor (int j = 0; j &lt; matrix[i].size() - 1; j++) \t\t\t\tif(matrix[i][j] != INT32_MAX) matrix[i][j] -= min; \t}  \t\/\/\u0412\u044b\u0447\u0438\u0442\u0430\u0435\u043c \u0438\u0437 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \tfor (int i = 0; i &lt; matrix[matrix.size() - 1].size() - 1; i++) { \t\tint min = 0; \t\tif ((min = getMin(matrix, i, check::Col)) == INT32_MAX) { \t\t\tshowMatrix(matrix); \t\t\tstd::cout &lt;&lt; endl &lt;&lt; &quot;Bad road&quot; &lt;&lt; endl; \t\t\treturn; \t\t} \t\tif ((min = getMin(matrix, i, check::Col)) != 0) \t\t\tfor (int j = 0; j &lt; matrix.size() - 1; j++) \t\t\t\tif (matrix[j][i] != INT32_MAX) matrix[j][i] -= min; \t}  \t\/\/\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u043e \u043e\u0446\u0435\u043d\u0435\u043d\u043d\u044b\u0439 \u043d\u043e\u043b\u044c \tint Max = 0; \tfor (int i = 0; i &lt; matrix.size() - 1; i++) \t\tfor (int j = 0; j &lt; matrix[i].size() - 1; j++) \t\t\tif (matrix[i][j] == 0) { \t\t\t\tmatrix[i][j] = INT32_MAX; \t\t\t\tint max = (getMin(matrix, i, check::Row) == INT32_MAX || getMin(matrix, j, check::Col) == INT32_MAX)? INT32_MAX: getMin(matrix, i, check::Row) + getMin(matrix, j, check::Col); \t\t\t\tif (max &gt; Max) Max = max; \t\t\t\tmatrix[i][j] = 0; \t\t\t}  \t\/\/\u041d\u0430\u0445\u043e\u0434\u0438\u043c \u0432\u0441\u0435 \u043d\u0443\u043b\u0438 \u043c\u0430\u043a\u0441\u0438\u043c\u0430\u043b\u044c\u043d\u0430\u044f \u043e\u0446\u0435\u043d\u043a\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u0440\u0430\u0432\u043d\u0430 Max \tvector&lt;pair&lt;int, int&gt;&gt; Maxs; \tfor (int i = 0; i &lt; matrix.size() - 1; i++) \t\tfor (int j = 0; j &lt; matrix[i].size() - 1; j++) \t\t\tif (matrix[i][j] == 0) { \t\t\t\tmatrix[i][j] = INT32_MAX; \t\t\t\tint max = (getMin(matrix, i, check::Row) == INT32_MAX || getMin(matrix, j, check::Col) == INT32_MAX) ? INT32_MAX : getMin(matrix, i, check::Row) + getMin(matrix, j, check::Col); \t\t\t\tif (max == Max) Maxs.push_back(pair&lt;int, int&gt;(matrix[i][matrix.size() - 1], matrix[matrix.size() - 1][j])); \t\t\t\tmatrix[i][j] = 0; \t\t\t} \t\/\/\u0412\u044b\u0432\u043e\u0434 \u043a\u043e\u043e\u0440\u0434\u0438\u043d\u0430\u0442 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u044b\u0445 \u043d\u0443\u043b\u0435\u0439 \tstd::cout &lt;&lt; &quot;Maxs - &quot;; \tfor (int i = 0; i &lt; Maxs.size(); i++) \t\tstd::cout &lt;&lt; Maxs[i].first &lt;&lt; &quot; &quot; &lt;&lt; Maxs[i].second &lt;&lt; &quot;\\t&quot;; \tstd::cout &lt;&lt; endl; \t\/\/\u0412\u044b\u0432\u043e\u0434 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \tshowMatrix(matrix); \tstd::cout &lt;&lt; endl; \t\/\/\u0417\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 \u0434\u0430\u043d\u043d\u043e\u0439 \u0432\u0435\u0442\u0432\u0438 \u0435\u0441\u043b\u0438 \u043d\u0435\u0442\u0443 \u043d\u0443\u043b\u0435\u0439 \tif (Maxs.size() == 0) { \t\tstd::cout &lt;&lt; &quot;Bad road.&quot; &lt;&lt; endl; \t\treturn; \t} \t \tfor (int i = 0; i &lt; Maxs.size(); i++) { \t\t\/\/\u0414\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0432\u0435\u0440\u0448\u0438\u043d\u0443 \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \t\tresult.push_back(Maxs[i]); \t\t\/\/\u0415\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043f\u043e\u0440\u044f\u0434\u043a\u0430 1, \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0438 \u0437\u0430\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u0442\u0435\u043a\u0443\u0449\u0438\u044e \u0432\u0435\u0442\u0432\u044c \t\tif (matrix.size() - 1 == 1) { \t\t\tfor (int i = 0; i &lt; result.size(); i++) \t\t\t\tstd::cout &lt;&lt; &quot;(&quot; &lt;&lt; result[i].first &lt;&lt; &quot;, &quot; &lt;&lt; result[i].second &lt;&lt; &quot;)\\t&quot;; \t\t\tstd::cout &lt;&lt; endl; \t\t\tstd::cout &lt;&lt; &quot;Result: &quot; &lt;&lt; getResultSum() &lt;&lt; endl; \t\t\tresult.pop_back(); \t\t\treturn; \t\t} \t\t\/\/\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043a\u043e\u043f\u0438\u044e \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0438 \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u0437 \u043d\u0435\u0435 \u0441\u0442\u0440\u043e\u043a\u0443 \u0438 \u0441\u0442\u043e\u043b\u0431\u0435\u0446 \u0432\u044b\u0431\u0440\u0430\u043d\u043d\u043e\u0433\u043e \u043d\u0443\u043b\u044f \t\tvector&lt;vector&lt;int&gt;&gt;  temp(matrix); \t\tpair&lt;int, int&gt; elem(INT32_MAX, INT32_MAX), elem1(INT32_MAX, INT32_MAX); \t\tfor (int j = 0; j &lt; temp[temp.size() - 1].size() - 1; j++) { \t\t\tif (Maxs[i].first == temp[j][temp[j].size() - 1]) elem.first = j; \t\t\tif (Maxs[i].second == temp[j][temp[j].size() - 1]) elem1.first = j; \t\t} \t\tfor (int j = 0; j &lt; temp.size() - 1; j++) { \t\t\tif (Maxs[i].second == temp[temp.size() - 1][j]) elem.second = j; \t\t\tif (Maxs[i].first == temp[temp.size() - 1][j]) elem1.second = j; \t\t}  \t\tfor(int i = 0; i &lt; temp.size() - 1; i++) \t\t\tfor(int j = 0;j&lt;temp.size() - 1; j++) \t\t\t\tif(i == elem1.first && j == elem1.second) \t\t\t\t\ttemp[elem1.first][elem1.second] = INT32_MAX;  \t\tfor (int j = 0; j &lt; temp[temp.size() - 1].size(); j++) \t\t\ttemp[j].erase(temp[j].begin() + elem.second); \t\ttemp.erase(temp.begin() + elem.first); \t\t\/\/\u0412\u044b\u0437\u044b\u0432\u0430\u0435\u043c \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u044d\u0442\u0443 \u0436\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043b\u044f \u0443\u0436\u0435 \u043d\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \t\tmatrixProcedure(temp); \t\t\/\/\u0423\u0434\u0430\u043b\u044f\u0435\u043c \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c  \t\tresult.pop_back(); \t} } <\/code><\/pre>\n<p>  <\/div>\n<\/div>\n<p>  <\/p>\n<h4><b>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/b><\/h4>\n<p>  \u041a \u043f\u0440\u0438\u043c\u0435\u0440\u0443 \u0434\u043b\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b:<\/p>\n<p>  <code>0 5 8 10 0 0 3 6<br \/>  5 0 2 0 0 0 0 1<br \/>  8 2 0 4 5 6 0 7<br \/>  10 0 4 0 12 9 7 0<br \/>  0 0 5 12 0 9 0 12<br \/>  0 0 6 9 9 0 8 0<br \/>  3 0 0 7 0 8 0 2<br \/>  6 1 7 0 12 0 2 0<br \/>  <\/code><br \/>  \u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u043e\u043c \u0431\u0443\u0434\u0435\u0442:<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/b><\/p>\n<div class=\"spoiler_text\"><code>Little algorithm:<br \/>  Maxs - 1 7 7 1<\/p>\n<p>  1 2 3 4 5 6 7 8<br \/>   ______________________________________________________<\/p>\n<p>  1 | inf 2 5 5 inf inf 0 3<br \/>  2 | 3 inf 1 inf inf inf inf 0<br \/>  3 | 5 0 inf 0 0 0 inf 5<br \/>  4 | 5 inf 0 inf 5 1 3 inf<br \/>  5 | inf inf 0 5 inf 0 inf 7<br \/>  6 | inf inf 0 1 0 inf 2 inf<br \/>  7 | 0 inf inf 3 inf 2 inf 0<br \/>  8 | 4 0 6 inf 8 inf 1 inf<\/p>\n<p>  Maxs - 7 8<\/p>\n<p>  1 2 3 4 5 6 8<br \/>   ________________________________________________<\/p>\n<p>  2 | 0 inf 1 inf inf inf 0<br \/>  3 | 2 0 inf 0 0 0 5<br \/>  4 | 2 inf 0 inf 5 1 inf<br \/>  5 | inf inf 0 5 inf 0 7<br \/>  6 | inf inf 0 1 0 inf inf<br \/>  7 | inf inf inf 3 inf 2 0<br \/>  8 | 1 0 6 inf 8 inf inf<\/p>\n<p>  Maxs - 8 2<\/p>\n<p>  1 2 3 4 5 6<br \/>   __________________________________________<\/p>\n<p>  2 | 0 inf 1 inf inf inf<br \/>  3 | 2 0 inf 0 0 0<br \/>  4 | 2 inf 0 inf 5 1<br \/>  5 | inf inf 0 5 inf 0<br \/>  6 | inf inf 0 1 0 inf<br \/>  8 | inf 0 6 inf 8 inf<\/p>\n<p>  Maxs - 2 3<\/p>\n<p>  1 3 4 5 6<br \/>   ____________________________________<\/p>\n<p>  2 | inf 0 inf inf inf<br \/>  3 | 0 inf 0 0 0<br \/>  4 | 0 0 inf 5 1<br \/>  5 | inf 0 5 inf 0<br \/>  6 | inf 0 1 0 inf<\/p>\n<p>  Maxs - 4 1<\/p>\n<p>  1 4 5 6<br \/>   ______________________________<\/p>\n<p>  3 | inf 0 0 0<br \/>  4 | 0 inf 5 1<br \/>  5 | inf 5 inf 0<br \/>  6 | inf 1 0 inf<\/p>\n<p>  Maxs - 5 6 6 4<\/p>\n<p>  4 5 6<br \/>   ________________________<\/p>\n<p>  3 | inf 0 0<br \/>  5 | 4 inf 0<br \/>  6 | 0 0 inf<\/p>\n<p>  Maxs - 3 5 6 4<\/p>\n<p>  4 5<br \/>   __________________<\/p>\n<p>  3 | inf 0<br \/>  6 | 0 inf<\/p>\n<p>  Maxs - 6 4<\/p>\n<p>  4<br \/>   ____________<\/p>\n<p>  6 | 0<\/p>\n<p>  (1, 7) (7, 8) (8, 2) (2, 3) (4, 1) (5, 6) (3, 5) (6, 4)<br \/>  Result: 41<br \/>  Maxs - 3 5<\/p>\n<p>  5<br \/>   ____________<\/p>\n<p>  3 | 0<\/p>\n<p>  (1, 7) (7, 8) (8, 2) (2, 3) (4, 1) (5, 6) (6, 4) (3, 5)<br \/>  Result: 41<br \/>  Maxs - 3 5 5 6<\/p>\n<p>  5 6<br \/>   __________________<\/p>\n<p>  3 | 0 0<br \/>  5 | inf 0<\/p>\n<p>  Maxs - 5 6<\/p>\n<p>  6<br \/>   ____________<\/p>\n<p>  5 | 0<\/p>\n<p>  (1, 7) (7, 8) (8, 2) (2, 3) (4, 1) (6, 4) (3, 5) (5, 6)<br \/>  Result: 41<br \/>  Maxs - 3 5<\/p>\n<p>  5<br \/>   ____________<\/p>\n<p>  3 | 0<\/p>\n<p>  (1, 7) (7, 8) (8, 2) (2, 3) (4, 1) (6, 4) (5, 6) (3, 5)<br \/>  Result: 41<br \/>  Maxs - 2 8<\/p>\n<p>  2 3 4 5 6 7 8<br \/>   ________________________________________________<\/p>\n<p>  1 | 0 3 3 inf inf inf 1<br \/>  2 | inf 1 inf inf inf inf 0<br \/>  3 | 0 inf 0 0 0 inf 5<br \/>  4 | inf 0 inf 5 1 2 inf<br \/>  5 | inf 0 5 inf 0 inf 7<br \/>  6 | inf 0 1 0 inf 1 inf<br \/>  8 | 0 6 inf 8 inf 0 inf<\/p>\n<p>  Maxs - 3 2<\/p>\n<p>  2 3 4 5 6 7<br \/>   __________________________________________<\/p>\n<p>  1 | inf 0 0 inf inf inf<br \/>  3 | 0 inf 0 0 0 inf<br \/>  4 | inf 0 inf 5 1 1<br \/>  5 | inf 0 5 inf 0 inf<br \/>  6 | inf 0 1 0 inf 0<br \/>  8 | inf 0 inf 2 inf inf<\/p>\n<p>  Maxs - 1 4 8 5<\/p>\n<p>  3 4 5 6 7<br \/>   ____________________________________<\/p>\n<p>  1 | inf 0 inf inf inf<br \/>  4 | 0 inf 5 1 1<br \/>  5 | 0 5 inf 0 inf<br \/>  6 | 0 1 0 inf 0<br \/>  8 | inf inf 0 inf inf<\/p>\n<p>  Maxs - 6 7 8 5<\/p>\n<p>  3 5 6 7<br \/>   ______________________________<\/p>\n<p>  4 | inf 4 0 inf<br \/>  5 | 0 inf 0 inf<br \/>  6 | 0 0 inf 0<br \/>  8 | inf 0 inf inf<\/p>\n<p>  Maxs - 4 5 5 3 5 6 8 5<\/p>\n<p>  3 5 6<br \/>   ________________________<\/p>\n<p>  4 | inf 0 inf<br \/>  5 | 0 inf 0<br \/>  8 | inf 0 inf<\/p>\n<p>  3 6<br \/>   __________________<\/p>\n<p>  5 | 0 0<br \/>  8 | inf inf<\/p>\n<p>  Bad road<\/p>\n<p>  5 6<br \/>   __________________<\/p>\n<p>  4 | 0 inf<br \/>  8 | 0 inf<\/p>\n<p>  Bad road<\/p>\n<p>  3 5<br \/>   __________________<\/p>\n<p>  4 | inf 0<br \/>  8 | inf 0<\/p>\n<p>  Bad road<\/p>\n<p>  3 6<br \/>   __________________<\/p>\n<p>  4 | inf inf<br \/>  5 | 0 0<\/p>\n<p>  Bad road<br \/>  Maxs - 4 6 5 6 6 3 6 7<\/p>\n<p>  3 6 7<br \/>   ________________________<\/p>\n<p>  4 | inf 0 inf<br \/>  5 | inf 0 inf<br \/>  6 | 0 inf 0<\/p>\n<p>  3 7<br \/>   __________________<\/p>\n<p>  5 | inf inf<br \/>  6 | 0 0<\/p>\n<p>  Bad road<\/p>\n<p>  3 7<br \/>   __________________<\/p>\n<p>  4 | inf inf<br \/>  6 | 0 0<\/p>\n<p>  Bad road<\/p>\n<p>  6 7<br \/>   __________________<\/p>\n<p>  4 | 0 inf<br \/>  5 | 0 inf<\/p>\n<p>  Bad road<\/p>\n<p>  3 6<br \/>   __________________<\/p>\n<p>  4 | inf 0<br \/>  5 | inf 0<\/p>\n<p>  Bad road<br \/>  Maxs - 1 4<\/p>\n<p>  3 4 6 7<br \/>   ______________________________<\/p>\n<p>  1 | inf 0 inf inf<br \/>  4 | 0 inf 1 1<br \/>  5 | inf 5 0 inf<br \/>  6 | 0 1 inf 0<\/p>\n<p>  Maxs - 4 6 5 6 6 3 6 7<\/p>\n<p>  3 6 7<br \/>   ________________________<\/p>\n<p>  4 | inf 0 inf<br \/>  5 | inf 0 inf<br \/>  6 | 0 inf 0<\/p>\n<p>  3 7<br \/>   __________________<\/p>\n<p>  5 | inf inf<br \/>  6 | 0 0<\/p>\n<p>  Bad road<\/p>\n<p>  3 7<br \/>   __________________<\/p>\n<p>  4 | inf inf<br \/>  6 | 0 0<\/p>\n<p>  Bad road<\/p>\n<p>  6 7<br \/>   __________________<\/p>\n<p>  4 | 0 inf<br \/>  5 | 0 inf<\/p>\n<p>  Bad road<\/p>\n<p>  3 6<br \/>   __________________<\/p>\n<p>  4 | inf 0<br \/>  5 | inf 0<\/p>\n<p>  Bad road<\/code>  <\/div>\n<\/div>\n<p>  \u0415\u0441\u0442\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043f\u043e\u043b\u043d\u044b\u0439 \u0432\u044b\u0432\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0438 \u0432\u044b\u0432\u043e\u0434 \u0432\u0441\u0435\u0445 \u0432\u0435\u0442\u0432\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043a\u043b\u044e\u0447\u0438\u0442\u044c. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e, \u044f \u0441\u0434\u0435\u043b\u0430\u043b \u043c\u043d\u043e\u0433\u043e \u043b\u0438\u0448\u043d\u0435\u0439 \u0440\u0430\u0431\u043e\u0442\u044b, \u043d\u043e \u043d\u0430\u0434\u0435\u044e\u0441\u044c \u043c\u043e\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0447\u0435\u043c-\u043d\u0438\u0431\u0443\u0434\u044c \u0432\u0430\u043c \u043f\u043e\u043c\u043e\u0436\u0435\u0442.<\/p>\n<p>  \u2192 <a href=\"https:\/\/drive.google.com\/open?id=0BwWa5LN4_ObRRDhXVEdsOEk0ekE\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0435 \u0444\u0430\u0439\u043b\u044b<\/a><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:\/\/habrahabr.ru\/post\/316014\/\"> https:\/\/habrahabr.ru\/post\/316014\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u041e\u0431\u0443\u0447\u0430\u044f\u0441\u044c \u0432 \u0443\u043d\u0438\u0432\u0435\u0440\u0441\u0438\u0442\u0435\u0442\u0435, \u043a\u0430\u0436\u0434\u043e\u043c\u0443 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u043b\u043e\u0441\u044c \u0434\u0435\u043b\u0430\u0442\u044c \u0440\u0430\u0437\u043d\u043e\u0433\u043e \u0440\u043e\u0434\u0430 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412\u043e\u0442, \u043d\u0430\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u043a\u043e\u043d\u0435\u0446 \u043f\u043e\u043b\u0443\u0433\u043e\u0434\u0438\u044f, \u0441\u0435\u0441\u0441\u0438\u044f \u043d\u0430 \u043d\u043e\u0441\u0443, \u043d\u0430\u0447\u0430\u043b\u043e \u0432\u044b\u0434\u0430\u0447\u0438 \u043a\u0443\u0440\u0441\u043e\u0432\u044b\u0445 \u0437\u0430\u0434\u0430\u043d\u0438\u0439 \u0438 \u043c\u043d\u0435 \u043f\u043e\u0441\u0447\u0430\u0441\u0442\u043b\u0438\u0432\u0438\u043b\u043e\u0441\u044c \u0441\u0442\u0430\u0442\u044c \u0442\u0435\u043c, \u043a\u0442\u043e \u0434\u043e\u043b\u0436\u0435\u043d \u0440\u0435\u0430\u043b\u0438\u0437\u043e\u0432\u0430\u0442\u044c \u043c\u0435\u0442\u043e\u0434 \u041b\u0438\u0442\u0442\u043b\u0430 \u0434\u043b\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440\u0430. \u0418\u0442\u0430\u043a \u043d\u0430\u0447\u043d\u0435\u043c. <\/p>\n<p>  \u041a\u0442\u043e \u0442\u0430\u043a\u043e\u0439 \u043a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440? \u041a\u043e\u043c\u043c\u0438\u0432\u043e\u044f\u0436\u0435\u0440 \u2014 \u044d\u0442\u043e \u0440\u0430\u0437\u044a\u0435\u0437\u0434\u043d\u043e\u0439 \u0442\u043e\u0440\u0433\u043e\u0432\u044b\u0439 \u0430\u0433\u0435\u043d\u0442 \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u0444\u0438\u0440\u043c\u044b, \u043f\u0440\u0435\u0434\u043b\u0430\u0433\u0430\u044e\u0449\u0438\u0439 \u043f\u043e\u043a\u0443\u043f\u0430\u0442\u0435\u043b\u044f\u043c \u0442\u043e\u0432\u0430\u0440\u044b \u043f\u043e \u043e\u0431\u0440\u0430\u0437\u0446\u0430\u043c \u0438 \u043a\u0430\u0442\u0430\u043b\u043e\u0433\u0430\u043c. \u0415\u0433\u043e \u0437\u0430\u0434\u0430\u0447\u0430 \u043e\u0431\u044a\u0435\u0437\u0434\u0438\u0442\u044c \u0432\u0441\u0435 \u043f\u0443\u043d\u043a\u0442\u044b \u043d\u0430\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u043d\u0435 \u043f\u043e\u0431\u044b\u0432\u0430\u0432 \u043d\u0438 \u0432 \u043e\u0434\u043d\u043e\u043c \u0434\u0432\u0430\u0436\u0434\u044b \u0438 \u0432\u0435\u0440\u043d\u0443\u0442\u044c\u0441\u044f \u0432 \u0442\u043e\u0447\u043a\u0443 \u0441\u0442\u0430\u0440\u0442\u0430.<\/p>\n<div style=\"text-align:center;\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/ef4\/c68\/155\/ef4c6815518d4d6aa5ea2073b56e8291.jpg\" alt=\"image\" \/><\/div>\n<p>  <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-281467","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/281467","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=281467"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/281467\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=281467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=281467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=281467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}