{"id":387702,"date":"2024-06-29T07:28:52","date_gmt":"2024-06-29T07:28:52","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=387702"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=387702","title":{"rendered":"<span>\u042d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e\u0435 \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u043e\u0432: \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/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<blockquote>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: <strong>\u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/strong> \u0438 <strong>\u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/strong>. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<\/blockquote>\n<h3>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u0440\u0430\u0444\u0430<\/h3>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438, \u0440\u0430\u0432\u043d\u044f\u0435\u0442\u0441\u044f <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"n^2\" alt=\"n^2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/9e7\/cd4\/ea3\/9e7cd4ea3feddac35d16697f69054d27.svg\" width=\"21\" height=\"21\"\/> \u0433\u0434\u0435 <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/2d1\/d22\/906\/2d1d22906aee30cd6155d89bab634082.svg\" width=\"12\" height=\"12\"\/>&#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0440\u0448\u0438\u043d \u0432 \u0433\u0440\u0430\u0444\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043d:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/aec\/3a4\/66e\/aec3a466e42dcf7523a4078e52802573.png\" alt=\"\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\" title=\"\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\" width=\"1120\" height=\"631\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/aec\/3a4\/66e\/aec3a466e42dcf7523a4078e52802573.png\"\/><figcaption>\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444<\/figcaption><\/figure>\n<p>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434:                                                  (<code>INF<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0440\u0435\u0431\u0440\u0430)<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">7<\/p>\n<\/td>\n<td data-colwidth=\"167\" width=\"167\">\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">5<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td data-colwidth=\"167\" width=\"167\">\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">9<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td data-colwidth=\"167\" width=\"167\">\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td data-colwidth=\"167\" width=\"167\">\n<p align=\"center\">2<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u0411\u0438\u0442\u043e\u0432\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0441 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0432\u0435\u0441\u0430 \u0440\u0435\u0431\u0435\u0440 \u0433\u0440\u0430\u0444\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043b\u0438\u0448\u044c \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0440\u0435\u0431\u0440\u0430 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0432 \u0434\u0440\u0443\u0433\u0443\u044e. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043f\u043e\u0434 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430, \u043c\u043e\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0432 8 \u0440\u0430\u0437, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043e: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"(n^2\/8) + 1\" alt=\"(n^2\/8) + 1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b84\/7d1\/8ac\/b847d18ac2e5e37f42e445b203bcf7ce.svg\" width=\"89\" height=\"25\"\/>.                                                                                                    \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 <em>\u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/em> \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0430. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u043d\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043d\u0443\u043b\u044f\u043c\u0438.<\/p>\n<ol>\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0431\u0438\u0442\u043e\u0432\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cmake\">index = (line * numberOfVertices + column) \/ 8; binaryMask = 128 >> ((line * numberOfVertices + column) % 8); matrix[index] |= binaryMask;<\/code><\/pre>\n<p>\u0427\u0438\u0441\u043b\u043e 128 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a: \u0435\u0433\u043e \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0435 \u0437\u0430\u043f\u0438\u0441\u044c = <code>10000000<\/code><sub>2<\/sub>.                    \u0417\u0434\u0435\u0441\u044c binaryMask \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 <em>\u0434\u0432\u043e\u0438\u0447\u043d\u0443\u044e \u043c\u0430\u0441\u043a\u0443<\/em> \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0440\u0435\u0431\u0440\u0430 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u0430\u0440\u044b \u0432\u0435\u0440\u0448\u0438\u043d line \u0438 column, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c\u0443\u044e <em>\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u043c \u0441\u0434\u0432\u0438\u0433\u043e\u043c<\/em> \u0432\u043f\u0440\u0430\u0432\u043e. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 &#171;<em>\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0438\u043b\u0438&#187; <\/em>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0443.<\/p>\n<ol start=\"2\">\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cmake\">index = (line * numberOfVertices + column) \/ 8; binaryMask = 128 >> ((line * numberOfVertices + column) % 8); binaryMask &amp;= matrix[index];<\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u0438\u0439 \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e: \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e &#171;<em>\u043f\u043e\u0431\u0438\u0442\u043e\u0433\u043e \u0438\u043b\u0438&#187; <\/em>\u0434\u043b\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u043c\u044b \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e &#171;<em>\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0438&#187; <\/em>\u0434\u043b\u044f \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u043c\u0430\u0441\u043a\u0438,<em> <\/em>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0437\u043d\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0440\u0435\u0431\u0440\u0430 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 line \u0438 column: \u0435\u0441\u043b\u0438 binaryMask == 0, \u0442\u043e \u0440\u0435\u0431\u0440\u0430 \u043d\u0435\u0442, \u0438\u043d\u0430\u0447\u0435 &#8212; \u0440\u0435\u0431\u0440\u043e \u0435\u0441\u0442\u044c.<\/p>\n<p>\u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435, \u044f \u043f\u043e\u043b\u0430\u0433\u0430\u043b \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e, \u0447\u0442\u043e line \u0438 column &#8212; \u044d\u0442\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0433\u0440\u0430\u0444\u0430, \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 >= 1.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438:<\/h2>\n<p>\u041f\u0443\u0441\u0442\u044c \u0434\u0430\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444:<\/p>\n<figure class=\"full-width\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/a72\/04a\/5ee\/a7204a5ee8a0bfaff6a76cbcd0cbe04a.png\" alt=\"\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\" title=\"\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\" width=\"1120\" height=\"631\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a72\/04a\/5ee\/a7204a5ee8a0bfaff6a76cbcd0cbe04a.png\"\/><figcaption>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444<\/figcaption><\/figure>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u044f\u0442\u044c\u0441\u044f: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"size = (4^2 \/8)+1 = 3\" alt=\"size = (4^2 \/8)+1 = 3\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/54c\/e98\/2ac\/54ce982acf46f263a2179da8184debcf.svg\" width=\"183\" height=\"25\"\/><\/p>\n<p>\u0410 \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0430\u043a\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434: (<em>\u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u044f\u0447\u0435\u0435\u043a \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441 \u043d\u0443\u043b\u044f<\/em>)<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u0431\u0440\u043e <code>1-2:<\/code> <br \/><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"index = (1 * 4 + 2) \/ 8 = 0\" alt=\"index = (1 * 4 + 2) \/ 8 = 0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0b2\/e35\/e8b\/0b2e35e8b6bccd6d1915ea1880ec3743.svg\" width=\"218\" height=\"22\"\/><br \/><img class=\"formula inline\" source=\"binaryMask = 128 >> 6 = 2 = 00000010&#8243; alt=&#187;binaryMask = 128 >> 6 = 2 = 00000010&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8aa\/b75\/a1d\/8aab75a1d42345a9a945264489a784a8.svg&#187; width=&#187;353&#8243; height=&#187;21&#8243;\/><sub>2<\/sub><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0 0 0 0 0 0 1 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 0 0 0 0 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 0 0 0 0 0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u0431\u0440\u043e <code>1-4:<\/code> <br \/><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"index = (1 * 4 + 4) \/ 8 = 1\" alt=\"index = (1 * 4 + 4) \/ 8 = 1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b23\/cf0\/ea6\/b23cf0ea6b176ffe4a6d88aeda1bde75.svg\" width=\"218\" height=\"22\"\/><br \/><img class=\"formula inline\" source=\"binaryMask = 128 >> 0 = 128 = 10000000&#8243; alt=&#187;binaryMask = 128 >> 0 = 128 = 10000000&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f43\/f54\/a83\/f43f54a83c59bf715b0a73b022fd6442.svg&#187; width=&#187;373&#8243; height=&#187;21&#8243;\/><sub>2<\/sub><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0 0 0 0 0 0 1 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">1 0 0 0 0 0 0 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 0 0 0 0 0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u0431\u0440\u043e <code>2-4:<\/code> <br \/><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"index = (2 * 4 + 4) \/ 8 = 1\" alt=\"index = (2 * 4 + 4) \/ 8 = 1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/477\/c5f\/0bc\/477c5f0bc47e1e2177e4f5b04ddce7c0.svg\" width=\"218\" height=\"22\"\/><br \/><img class=\"formula inline\" source=\"binaryMask = 128 >> 4 = 8 = 00001000&#8243; alt=&#187;binaryMask = 128 >> 4 = 8 = 00001000&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/389\/4f0\/871\/3894f0871e6a7fc94e9743c107ffb685.svg&#187; width=&#187;353&#8243; height=&#187;21&#8243;\/><sub>2<\/sub><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0 0 0 0 0 0 1 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">1 0 0 0 1 0 0 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 0 0 0 0 0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u0431\u0440\u043e <code>4-3:<\/code> <br \/><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"index = (4 * 4 + 3) \/ 8 = 2\" alt=\"index = (4 * 4 + 3) \/ 8 = 2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4f4\/6b8\/0e3\/4f46b80e341b085c387f4cc72e070de3.svg\" width=\"218\" height=\"22\"\/><br \/><img class=\"formula inline\" source=\"binaryMask = 128 >> 3 = 16 = 00010000&#8243; alt=&#187;binaryMask = 128 >> 3 = 16 = 00010000&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/52e\/68e\/b05\/52e68eb05abbd357bba77e8e91b2feeb.svg&#187; width=&#187;363&#8243; height=&#187;21&#8243;\/><sub>2<\/sub><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0 0 0 0 0 0 1 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">1 0 0 0 1 0 0 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 1 0 0 0 0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><em>\u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u0433\u0440\u0430\u0444\u0435 \u0440\u0435\u0431\u0440\u043e \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 <\/em><code>1-4<\/code><em>?<\/em><br \/><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"index(1;4) = (1*4+4)\/8=1\" alt=\"index(1;4) = (1*4+4)\/8=1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/3a3\/0b6\/42c\/3a30b642c0197751faf91379bfa7c923.svg\" width=\"261\" height=\"22\"\/><br \/><img class=\"formula inline\" source=\"binaryMask(1;4) = 128 >> 0 = 128&#8243; alt=&#187;binaryMask(1;4) = 128 >> 0 = 128&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/606\/dfa\/1c0\/606dfa1c07d8a3b6bf38be4c092a59b9.svg&#187; width=&#187;312&#8243; height=&#187;22&#8243;\/><\/p>\n<p><code>10001000<\/code> &amp; <code>10000000<\/code> = <code>1<\/code>  => <em>\u0440\u0435\u0431\u0440\u043e \u0435\u0441\u0442\u044c<\/em>.<\/p>\n<p><em>\u0410 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 <\/em><code>1-3<\/code><em>?<\/em><br \/><img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"index(1;3) = (1*4+3)\/8=0\" alt=\"index(1;3) = (1*4+3)\/8=0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a37\/4e9\/f6c\/a374e9f6cbc3f8f59219fe44647b97db.svg\" width=\"261\" height=\"22\"\/><br \/><img class=\"formula inline\" source=\"binaryMask(1;3) = 128 >> 7 = 1&#8243; alt=&#187;binaryMask(1;3) = 128 >> 7 = 1&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0b2\/1f7\/858\/0b21f785856d56ab0fbfff0687ec1f79.svg&#187; width=&#187;292&#8243; height=&#187;22&#8243;\/><\/p>\n<p><code>00000010<\/code> &amp; <code>00000001<\/code> = <code>0<\/code>  => <em>\u0440\u0435\u0431\u0440\u0430 \u043d\u0435\u0442<\/em>.<\/p>\n<hr\/>\n<h2>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b (\u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0439) \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u0443\u044e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u0443:<\/p>\n<figure class=\"\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/024\/401\/214\/024401214c0765bb887830f739d3725a.png\" alt=\"\u041d\u0435\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\" title=\"\u041d\u0435\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444\" width=\"362\" height=\"280\" data-src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/024\/401\/214\/024401214c0765bb887830f739d3725a.png\"\/><figcaption>\u041d\u0435\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444<\/figcaption><\/figure>\n<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">4<\/p>\n<\/td>\n<td>\n<p align=\"center\">8<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">4<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">17<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">8<\/p>\n<\/td>\n<td>\n<p align=\"center\">17<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043f\u043e\u0434 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u044f\u0442\u044c\u0441\u044f: <img loading=\"lazy\" decoding=\"async\" class=\"formula inline\" source=\"n * (n+1)\/2\" alt=\"n * (n+1)\/2\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/69e\/f91\/f75\/69ef91f75e6f08960de7296f8dade9a1.svg\" width=\"111\" height=\"22\"\/>, \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0451 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c.<\/p>\n<p>\u0422\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430 \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">4<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">8<\/p>\n<\/td>\n<td>\n<p align=\"center\">17<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ol>\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cmake\">maxVertex = max(line, column); minVertex = min(line, column); index = (maxVertex * (maxVertex - 1) \/ 2) + minVertex - 1;<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0432\u044b\u0448\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u044f \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b line \u0438 column \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 \u0433\u0440\u0430\u0444\u0430, \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 >= 1.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u042d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u0451 \u0432\u0440\u0435\u043c\u044f \u0441\u0430\u043c \u043d\u0443\u0436\u0434\u0430\u043b\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0432\u0441\u0435\u0445 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433 \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c.<\/p>\n<hr\/>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0433\u0440\u0430\u0444\u043e\u0432 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0430\u0439\u0442\u0430: <a href=\"https:\/\/graphonline.ru\" rel=\"noopener noreferrer nofollow\">graphonline.ru<\/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\/660567\/\"> https:\/\/habr.com\/ru\/articles\/660567\/<\/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<blockquote>\n<p>\u041a\u0430\u043a \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0433\u0440\u0430\u0444\u0430 \u0432 \u043f\u0430\u043c\u044f\u0442\u0438 \u043f\u0440\u0435\u0438\u043c\u0443\u0449\u0435\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0434\u0432\u0443\u043c\u044f \u0441\u043f\u043e\u0441\u043e\u0431\u0430\u043c\u0438: <strong>\u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/strong> \u0438 <strong>\u0441\u043f\u0438\u0441\u043a\u043e\u043c \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/strong>. \u041e\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u043c\u0441\u044f \u043d\u0430 \u043f\u0435\u0440\u0432\u043e\u043c \u0438\u0437 \u043d\u0438\u0445.<\/p>\n<\/blockquote>\n<h3>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0433\u0440\u0430\u0444\u0430<\/h3>\n<p>\u0421\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043e\u0431\u044b\u043a\u043d\u043e\u0432\u0435\u043d\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438, \u0440\u0430\u0432\u043d\u044f\u0435\u0442\u0441\u044f  \u0433\u0434\u0435 &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u0435\u0440\u0448\u0438\u043d \u0432 \u0433\u0440\u0430\u0444\u0435.<\/p>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u0447\u0435\u0442\u044b\u0440\u0435\u0445 \u0432\u0435\u0440\u0448\u0438\u043d:<\/p>\n<figure class=\"full-width\"><figcaption>\u041e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444<\/figcaption><\/figure>\n<p>\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0434\u043b\u044f \u0442\u0430\u043a\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430 \u0431\u0443\u0434\u0435\u0442 \u0438\u043c\u0435\u0442\u044c \u0432\u0438\u0434:                                                  (<code>INF<\/code> \u043e\u0437\u043d\u0430\u0447\u0430\u0435\u0442 \u043e\u0442\u0441\u0443\u0442\u0441\u0442\u0432\u0438\u0435 \u0440\u0435\u0431\u0440\u0430)<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">7<\/p>\n<\/td>\n<td data-colwidth=\"167\" width=\"167\">\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">5<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td data-colwidth=\"167\" width=\"167\">\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">9<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td data-colwidth=\"167\" width=\"167\">\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td data-colwidth=\"167\" width=\"167\">\n<p align=\"center\">2<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<h2>\u0411\u0438\u0442\u043e\u0432\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u041f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u043c, \u0447\u0442\u043e \u043d\u0430\u0441 \u043d\u0435 \u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u044e\u0442 \u0432\u0435\u0441\u0430 \u0440\u0435\u0431\u0435\u0440 \u0433\u0440\u0430\u0444\u0430, \u0442\u043e \u0435\u0441\u0442\u044c \u0431\u0443\u0434\u0435\u043c \u0433\u043e\u0432\u043e\u0440\u0438\u0442\u044c \u043b\u0438\u0448\u044c \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0440\u0435\u0431\u0440\u0430 \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0432 \u0434\u0440\u0443\u0433\u0443\u044e. \u0412 \u0442\u0430\u043a\u043e\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u0440\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043f\u043e\u0434 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430, \u043c\u043e\u0436\u043d\u043e \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u0432 8 \u0440\u0430\u0437, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e \u0434\u043e: .                                                                                                    \u041d\u0430\u0437\u043e\u0432\u0435\u043c \u0442\u0430\u043a\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 <em>\u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/em> \u0434\u043b\u044f \u0433\u0440\u0430\u0444\u0430. \u0418\u0437\u043d\u0430\u0447\u0430\u043b\u044c\u043d\u043e \u043e\u043d\u0430 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d\u0430 \u043d\u0443\u043b\u044f\u043c\u0438.<\/p>\n<ol>\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u0431\u0438\u0442\u043e\u0432\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cmake\">index = (line * numberOfVertices + column) \/ 8; binaryMask = 128 >> ((line * numberOfVertices + column) % 8); matrix[index] |= binaryMask;<\/code><\/pre>\n<p>\u0427\u0438\u0441\u043b\u043e 128 \u0432\u044b\u0431\u0440\u0430\u043d\u043e \u043d\u0435 \u043f\u0440\u043e\u0441\u0442\u043e \u0442\u0430\u043a: \u0435\u0433\u043e \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0435 \u0437\u0430\u043f\u0438\u0441\u044c = <code>10000000<\/code><sub>2<\/sub>.                    \u0417\u0434\u0435\u0441\u044c binaryMask \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u043e\u0431\u043e\u0439 <em>\u0434\u0432\u043e\u0438\u0447\u043d\u0443\u044e \u043c\u0430\u0441\u043a\u0443<\/em> \u043d\u0430\u043b\u0438\u0447\u0438\u044f \u0440\u0435\u0431\u0440\u0430 \u0434\u043b\u044f \u0442\u0435\u043a\u0443\u0449\u0435\u0439 \u043f\u0430\u0440\u044b \u0432\u0435\u0440\u0448\u0438\u043d line \u0438 column, \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u043c\u0443\u044e <em>\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u044b\u043c \u0441\u0434\u0432\u0438\u0433\u043e\u043c<\/em> \u0432\u043f\u0440\u0430\u0432\u043e. \u0414\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u0435 &#171;<em>\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0438\u043b\u0438&#187; <\/em>\u043f\u043e\u0437\u0432\u043e\u043b\u044f\u0435\u0442 \u0434\u043e\u0431\u0430\u0432\u0438\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0443.<\/p>\n<ol start=\"2\">\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cmake\">index = (line * numberOfVertices + column) \/ 8; binaryMask = 128 >> ((line * numberOfVertices + column) % 8); binaryMask &amp;= matrix[index];<\/code><\/pre>\n<p>\u041e\u0442\u043b\u0438\u0447\u0438\u0439 \u043e\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0435\u043c\u043d\u043e\u0433\u043e: \u0432\u043c\u0435\u0441\u0442\u043e \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0442\u044c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e &#171;<em>\u043f\u043e\u0431\u0438\u0442\u043e\u0433\u043e \u0438\u043b\u0438&#187; <\/em>\u0434\u043b\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u043c\u044b \u0441\u043e\u0432\u0435\u0440\u0448\u0430\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044e &#171;<em>\u043f\u043e\u0431\u0438\u0442\u043e\u0432\u043e\u0433\u043e \u0438&#187; <\/em>\u0434\u043b\u044f \u0434\u0432\u043e\u0438\u0447\u043d\u043e\u0439 \u043c\u0430\u0441\u043a\u0438,<em> <\/em>\u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0434\u0430\u0451\u0442 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0443\u0437\u043d\u0430\u0442\u044c \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u043d\u0430\u043b\u0438\u0447\u0438\u0438 \u0440\u0435\u0431\u0440\u0430 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 line \u0438 column: \u0435\u0441\u043b\u0438 binaryMask == 0, \u0442\u043e \u0440\u0435\u0431\u0440\u0430 \u043d\u0435\u0442, \u0438\u043d\u0430\u0447\u0435 &#8212; \u0440\u0435\u0431\u0440\u043e \u0435\u0441\u0442\u044c.<\/p>\n<p>\u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0432 \u0444\u0443\u043d\u043a\u0446\u0438\u044f\u0445, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0445 \u0432\u044b\u0448\u0435, \u044f \u043f\u043e\u043b\u0430\u0433\u0430\u043b \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e, \u0447\u0442\u043e line \u0438 column &#8212; \u044d\u0442\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0433\u0440\u0430\u0444\u0430, \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 >= 1.<\/p>\n<h2>\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435\u0439 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438:<\/h2>\n<p>\u041f\u0443\u0441\u0442\u044c \u0434\u0430\u043d \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444:<\/p>\n<figure class=\"full-width\"><figcaption>\u041f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u044b\u0439 \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444<\/figcaption><\/figure>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u044f\u0442\u044c\u0441\u044f: <\/p>\n<p>\u0410 \u0437\u043d\u0430\u0447\u0438\u0442 \u0442\u0430\u043a\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 \u0438\u043c\u0435\u0435\u0442 \u0432\u0438\u0434: (<em>\u0438\u043d\u0434\u0435\u043a\u0441\u0430\u0446\u0438\u044f \u044f\u0447\u0435\u0435\u043a \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441 \u043d\u0443\u043b\u044f<\/em>)<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u0431\u0440\u043e <code>1-2:<\/code> <\/p>\n<p>> 6 = 2 = 00000010&#8243; alt=&#187;binaryMask = 128 >> 6 = 2 = 00000010&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8aa\/b75\/a1d\/8aab75a1d42345a9a945264489a784a8.svg&#187; width=&#187;353&#8243; height=&#187;21&#8243;\/><sub>2<\/sub><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0 0 0 0 0 0 1 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 0 0 0 0 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 0 0 0 0 0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u0431\u0440\u043e <code>1-4:<\/code> <\/p>\n<p>> 0 = 128 = 10000000&#8243; alt=&#187;binaryMask = 128 >> 0 = 128 = 10000000&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f43\/f54\/a83\/f43f54a83c59bf715b0a73b022fd6442.svg&#187; width=&#187;373&#8243; height=&#187;21&#8243;\/><sub>2<\/sub><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0 0 0 0 0 0 1 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">1 0 0 0 0 0 0 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 0 0 0 0 0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0414\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u0431\u0440\u043e <code>2-4:<\/code> <\/p>\n<p>> 4 = 8 = 00001000&#8243; alt=&#187;binaryMask = 128 >> 4 = 8 = 00001000&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/389\/4f0\/871\/3894f0871e6a7fc94e9743c107ffb685.svg&#187; width=&#187;353&#8243; height=&#187;21&#8243;\/><sub>2<\/sub><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0 0 0 0 0 0 1 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">1 0 0 0 1 0 0 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 0 0 0 0 0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u041d\u0430\u043a\u043e\u043d\u0435\u0446, \u0434\u043e\u0431\u0430\u0432\u0438\u043c \u0440\u0435\u0431\u0440\u043e <code>4-3:<\/code> <\/p>\n<p>> 3 = 16 = 00010000&#8243; alt=&#187;binaryMask = 128 >> 3 = 16 = 00010000&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/52e\/68e\/b05\/52e68eb05abbd357bba77e8e91b2feeb.svg&#187; width=&#187;363&#8243; height=&#187;21&#8243;\/><sub>2<\/sub><\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\">0 0 0 0 0 0 1 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">1 0 0 0 1 0 0 0<\/p>\n<\/td>\n<td>\n<p align=\"center\">0 0 0 1 0 0 0 0<\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p><em>\u0422\u0435\u043f\u0435\u0440\u044c, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438, \u043f\u043e\u043f\u0440\u043e\u0431\u0443\u0435\u043c \u043e\u0442\u0432\u0435\u0442\u0438\u0442\u044c \u043d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0432\u043e\u043f\u0440\u043e\u0441: \u0435\u0441\u0442\u044c \u043b\u0438 \u0432 \u044d\u0442\u043e\u043c \u0433\u0440\u0430\u0444\u0435 \u0440\u0435\u0431\u0440\u043e \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 <\/em><code>1-4<\/code><em>?<\/em><\/p>\n<p>> 0 = 128&#8243; alt=&#187;binaryMask(1;4) = 128 >> 0 = 128&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/606\/dfa\/1c0\/606dfa1c07d8a3b6bf38be4c092a59b9.svg&#187; width=&#187;312&#8243; height=&#187;22&#8243;\/><\/p>\n<p><code>10001000<\/code> &amp; <code>10000000<\/code> = <code>1<\/code>  => <em>\u0440\u0435\u0431\u0440\u043e \u0435\u0441\u0442\u044c<\/em>.<\/p>\n<p><em>\u0410 \u043c\u0435\u0436\u0434\u0443 \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 <\/em><code>1-3<\/code><em>?<\/em><\/p>\n<p>> 7 = 1&#8243; alt=&#187;binaryMask(1;3) = 128 >> 7 = 1&#8243; src=&#187;https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0b2\/1f7\/858\/0b21f785856d56ab0fbfff0687ec1f79.svg&#187; width=&#187;292&#8243; height=&#187;22&#8243;\/><\/p>\n<p><code>00000010<\/code> &amp; <code>00000001<\/code> = <code>0<\/code>  => <em>\u0440\u0435\u0431\u0440\u0430 \u043d\u0435\u0442<\/em>.<\/p>\n<hr\/>\n<h2>\u0425\u0440\u0430\u043d\u0435\u043d\u0438\u0435 \u043f\u043e\u043b\u043e\u0432\u0438\u043d\u044b (\u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0439) \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438<\/h2>\n<p>\u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u043d\u0435\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430 \u043c\u044b \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0441\u0438\u043c\u043c\u0435\u0442\u0440\u0438\u0447\u043d\u0443\u044e \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0433\u043b\u0430\u0432\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u043c\u0430\u0442\u0440\u0438\u0446\u0443:<\/p>\n<figure class=\"\"><figcaption>\u041d\u0435\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u0433\u0440\u0430\u0444<\/figcaption><\/figure>\n<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">4<\/p>\n<\/td>\n<td>\n<p align=\"center\">8<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">4<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">17<\/p>\n<\/td>\n<\/tr>\n<tr>\n<td>\n<p align=\"center\">8<\/p>\n<\/td>\n<td>\n<p align=\"center\">17<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<p>\u0420\u0430\u0437\u043c\u0435\u0440, \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u043c\u044b\u0439 \u043f\u043e\u0434 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0443\u044e \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u043d\u0435\u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430, \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0432\u043d\u044f\u0442\u044c\u0441\u044f: , \u0435\u0441\u043b\u0438 \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0435\u0451 \u0433\u043b\u0430\u0432\u043d\u0443\u044e \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u044c.<\/p>\n<p>\u0422\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0442\u0430\u043a\u043e\u0433\u043e \u0433\u0440\u0430\u0444\u0430 \u043f\u0440\u0438\u043c\u0435\u0442 \u0432\u0438\u0434:<\/p>\n<div>\n<div class=\"table\">\n<table>\n<tbody>\n<tr>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">4<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<td>\n<p align=\"center\">8<\/p>\n<\/td>\n<td>\n<p align=\"center\">17<\/p>\n<\/td>\n<td>\n<p align=\"center\"><code>INF<\/code><\/p>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n<\/div>\n<ol>\n<li>\n<p>\u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u044f \u0438\u043d\u0434\u0435\u043a\u0441\u0430 \u0434\u043b\u044f \u044d\u0442\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b:<\/p>\n<\/li>\n<\/ol>\n<pre><code class=\"cmake\">maxVertex = max(line, column); minVertex = min(line, column); index = (maxVertex * (maxVertex - 1) \/ 2) + minVertex - 1;<\/code><\/pre>\n<ol start=\"2\">\n<li>\n<p>\u0414\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0438 \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u0438\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439 \u0438\u0437 \u0442\u0440\u0435\u0443\u0433\u043e\u043b\u044c\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e \u043e\u0431\u044b\u0447\u043d\u043e\u0439 \u043c\u0430\u0442\u0440\u0438\u0446\u0435 \u0441\u043c\u0435\u0436\u043d\u043e\u0441\u0442\u0438, \u043d\u043e \u043f\u043e \u0438\u043d\u0434\u0435\u043a\u0441\u0443, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u0432\u044b\u0448\u0435.<\/p>\n<\/li>\n<\/ol>\n<p>\u0417\u0430\u043c\u0435\u0447\u0443, \u0447\u0442\u043e \u0437\u0434\u0435\u0441\u044c \u044f \u0442\u0430\u043a \u0436\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u0430\u0433\u0430\u043b line \u0438 column \u0432\u0435\u0440\u0448\u0438\u043d\u0430\u043c\u0438 \u0433\u0440\u0430\u0444\u0430, \u043d\u043e\u043c\u0435\u0440\u0430 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 >= 1.<\/p>\n<h2>\u0418\u0442\u043e\u0433\u0438<\/h2>\n<p>\u042d\u0442\u0443 \u0441\u0442\u0430\u0442\u044c\u044e \u044f \u043d\u0430\u043f\u0438\u0441\u0430\u043b, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u0432 \u0441\u0432\u043e\u0451 \u0432\u0440\u0435\u043c\u044f \u0441\u0430\u043c \u043d\u0443\u0436\u0434\u0430\u043b\u0441\u044f \u0432 \u0434\u0430\u043d\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438. \u0411\u043b\u0430\u0433\u043e\u0434\u0430\u0440\u044e \u0432\u0441\u0435\u0445 \u0447\u0438\u0442\u0430\u0442\u0435\u043b\u0435\u0439 \u0438 \u043d\u0430\u0434\u0435\u044e\u0441\u044c, \u0447\u0442\u043e \u043f\u043e\u043c\u043e\u0433 \u043a\u043e\u043c\u0443-\u043d\u0438\u0431\u0443\u0434\u044c.<\/p>\n<hr\/>\n<p>\u0412\u0438\u0437\u0443\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u0433\u0440\u0430\u0444\u043e\u0432 \u043f\u0440\u043e\u0432\u043e\u0434\u0438\u043b \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0430\u0439\u0442\u0430: <a href=\"https:\/\/graphonline.ru\" rel=\"noopener noreferrer nofollow\">graphonline.ru<\/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\/660567\/\"> https:\/\/habr.com\/ru\/articles\/660567\/<\/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-387702","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/387702","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=387702"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/387702\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=387702"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=387702"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=387702"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}