{"id":471873,"date":"2025-08-23T15:16:29","date_gmt":"2025-08-23T15:16:29","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=471873"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=471873","title":{"rendered":"<span>\u0420\u0430\u043d\u0433-\u0441\u0435\u043b\u0435\u043a\u0442 \u0441\u043b\u043e\u0432\u0430\u0440\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<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c1d\/013\/7fb\/c1d0137fbb17135ad460164a41b6cddb.png\" alt=\"bitvector.png\" title=\"\u041f\u0440\u0438\u043c\u0435\u0440 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u043d\u0433\/\u0441\u0435\u043b\u0435\u043a\u0442 \u043d\u0430\u0434 \u043d\u0438\u043c, \u0441\u043f\u0440\u0430\u0432\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439.\" width=\"1830\" height=\"902\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/c1d\/013\/7fb\/c1d0137fbb17135ad460164a41b6cddb.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/c1d\/013\/7fb\/c1d0137fbb17135ad460164a41b6cddb.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u043d\u0433\/\u0441\u0435\u043b\u0435\u043a\u0442 \u043d\u0430\u0434 \u043d\u0438\u043c, \u0441\u043f\u0440\u0430\u0432\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439.<\/figcaption><\/div>\n<\/figure>\n<p>\u042d\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u043f\u0440\u043e <strong>succinct data structures <\/strong>&#8212; \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u043e\u0447\u0435\u043d\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b &#8212; \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u043a\u043e\u0431\u043e\u0447\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0434\u0435\u0440\u0435\u0432\u043e \u0438\u0437<img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 781w\" loading=\"lazy\" decode=\"async\"\/>\u0432\u0435\u0440\u0448\u0438\u043d \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e<img decoding=\"async\" class=\"formula inline\" source=\"2n\" alt=\"2n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/21\/21e\/21e2c0c0472b331622877accbe29b91b.svg\" width=\"16\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/21\/21e\/21e2c0c0472b331622877accbe29b91b.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/2\/21\/21e\/21e2c0c0472b331622877accbe29b91b.svg 781w\" loading=\"lazy\" decode=\"async\"\/>\u0431\u0438\u0442 \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0430 \u0431\u044b \u043a\u0430\u043a \u0434\u0432\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u043e 64-\u0431\u0438\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b (\u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438, \u043d\u043e \u0434\u0430\u0436\u0435 \u0431\u043b\u0438\u0437\u043a\u043e 2 \u0431\u0438\u0442\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c). \u0424\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 &#8212; \u044d\u0442\u043e <strong>rank-select \u0441\u043b\u043e\u0432\u0430\u0440\u044c<\/strong>, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u043e\u0439 \u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u0434\u0432\u0443\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 <em>\u0440\u0430\u043d\u0433<\/em> \u0438 <em>\u0441\u0435\u043b\u0435\u043a\u0442<\/em>. \u0412 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u043d\u0433\u0430 \u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e: \u043d\u0430\u0439\u0442\u0438 \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432\/\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439, \u0443\u0437\u043d\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u0430. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u043e 3,6% \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. <strong> <em> <\/em><\/strong><\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p><strong><em>Rank-select dictionary<\/em><\/strong> <strong>(RSD)<\/strong> &#8212; \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0432\u0435\u0440\u0445 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438<img decoding=\"async\" class=\"formula inline\" source=\"B\" alt=\"B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0434\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/p>\n<ul>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"Rank_1(k)\" alt=\"Rank_1(k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6e\/707\/146\/f6e707146d872572425a171cbab8d737.svg\" width=\"80\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6e\/707\/146\/f6e707146d872572425a171cbab8d737.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f6e\/707\/146\/f6e707146d872572425a171cbab8d737.svg 781w\" loading=\"lazy\" decode=\"async\"\/> &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0431\u0438\u0442 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445<img decoding=\"async\" class=\"formula inline\" source=\"0, \\ldots k-1\" alt=\"0, \\ldots k-1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/da\/da5\/da5a4ee279717ac923af07b6e87818bc.svg\" width=\"80\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/da\/da5\/da5a4ee279717ac923af07b6e87818bc.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/da\/da5\/da5a4ee279717ac923af07b6e87818bc.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0442.\u0435.<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"formula\" source=\"Rank(k)=\\sum_{i=0}^{k-1}B[i]\" alt=\"Rank(k)=\\sum_{i=0}^{k-1}B[i]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/739\/905\/1f1\/7399051f148c62e06b71eae655c81133.svg\" width=\"160\" height=\"60\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/739\/905\/1f1\/7399051f148c62e06b71eae655c81133.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/739\/905\/1f1\/7399051f148c62e06b71eae655c81133.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<ul>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"Select_1(k)\" alt=\"Select_1(k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/988\/ad1\/a9d\/988ad1a9d2b84f6007bec4da9cfb8fba.svg\" width=\"85\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/988\/ad1\/a9d\/988ad1a9d2b84f6007bec4da9cfb8fba.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/988\/ad1\/a9d\/988ad1a9d2b84f6007bec4da9cfb8fba.svg 781w\" loading=\"lazy\" decode=\"async\"\/> &#8212; \u043f\u043e\u0437\u0438\u0446\u0438\u044f<img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u0430, \u0442.\u0435. <\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"formula\" source=\"Select_1(k) = \\min\\{ \\ell~|~Rank_1(\\ell) = k \\}\" alt=\"Select_1(k) = \\min\\{ \\ell~|~Rank_1(\\ell) = k \\}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/671\/c14\/1e7\/671c141e7effa1e8cae85d6b56aca03c.svg\" width=\"300\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/671\/c14\/1e7\/671c141e7effa1e8cae85d6b56aca03c.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/671\/c14\/1e7\/671c141e7effa1e8cae85d6b56aca03c.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438<img decoding=\"async\" class=\"formula inline\" source=\"B=010010101110\" alt=\"B=010010101110\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/da\/dab\/dabf603032d10ace172353d170c0ae62.svg\" width=\"144\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/da\/dab\/dabf603032d10ace172353d170c0ae62.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/da\/dab\/dabf603032d10ace172353d170c0ae62.svg 781w\" loading=\"lazy\" decode=\"async\"\/> (\u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u0435\u0432\u0430-\u043d\u0430\u043f\u0440\u0430\u0432\u043e)<\/p>\n<ul>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"Select_1(k) = \\min\\{ \\ell~|~Rank_1(\\ell) = k \\}\" alt=\"Select_1(k) = \\min\\{ \\ell~|~Rank_1(\\ell) = k \\}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/10a\/cab\/6ef\/10acab6ef49c71d944f53c5144b57223.svg\" width=\"300\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/10a\/cab\/6ef\/10acab6ef49c71d944f53c5144b57223.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/10a\/cab\/6ef\/10acab6ef49c71d944f53c5144b57223.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<\/li>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"Select_1 = \\{1, 4, 6, 8, 9, 10\\}\" alt=\"Select_1 = \\{1, 4, 6, 8, 9, 10\\}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a3\/d53\/c13\/4a3d53c13ccad9ec79ca6004b8e839bc.svg\" width=\"216\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a3\/d53\/c13\/4a3d53c13ccad9ec79ca6004b8e839bc.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a3\/d53\/c13\/4a3d53c13ccad9ec79ca6004b8e839bc.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<\/li>\n<\/ul>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f<\/p>\n<ul>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"Rank_0(k)\" alt=\"Rank_0(k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/434\/d9f\/e64\/434d9fe64161468f56e6b7763ea71ee5.svg\" width=\"80\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/434\/d9f\/e64\/434d9fe64161468f56e6b7763ea71ee5.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/434\/d9f\/e64\/434d9fe64161468f56e6b7763ea71ee5.svg 781w\" loading=\"lazy\" decode=\"async\"\/> &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0438\u0442 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445<img decoding=\"async\" class=\"formula inline\" source=\"0, \\ldots, k-1\" alt=\"0, \\ldots, k-1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/aa\/aac\/aac5519786bca0821504a02fff766811.svg\" width=\"88\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/aa\/aac\/aac5519786bca0821504a02fff766811.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/aa\/aac\/aac5519786bca0821504a02fff766811.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"formula\" source=\"Rank_0(k)=\\sum_{i=0}^{k-1}(1-B[i])\" alt=\"Rank_0(k)=\\sum_{i=0}^{k-1}(1-B[i])\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d99\/747\/53e\/d9974753e4d2e42c7e066d2fe3e18ace.svg\" width=\"214\" height=\"60\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d99\/747\/53e\/d9974753e4d2e42c7e066d2fe3e18ace.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d99\/747\/53e\/d9974753e4d2e42c7e066d2fe3e18ace.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<ul>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"Select_0(k)\" alt=\"Select_0(k)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fed\/dec\/2fe\/feddec2fe0d709324dcf216adef68db3.svg\" width=\"85\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fed\/dec\/2fe\/feddec2fe0d709324dcf216adef68db3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fed\/dec\/2fe\/feddec2fe0d709324dcf216adef68db3.svg 781w\" loading=\"lazy\" decode=\"async\"\/> &#8212; \u043f\u043e\u0437\u0438\u0446\u0438\u044f<img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0433\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0431\u0438\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"formula\" source=\"Select_0(k)=\\min\\{\\ell~|~Rank_0(\\ell)=k\\}\" alt=\"Select_0(k)=\\min\\{\\ell~|~Rank_0(\\ell)=k\\}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/59f\/63a\/a19\/59f63aa199ddfc9afd88e7e2bbeee2ed.svg\" width=\"300\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/59f\/63a\/a19\/59f63aa199ddfc9afd88e7e2bbeee2ed.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/59f\/63a\/a19\/59f63aa199ddfc9afd88e7e2bbeee2ed.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3cd\/93e\/4b5\/3cd93e4b5f53b0c12c9bd0e1e6a272e9.png\" alt=\"image.png\" title=\"\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u043d\u0430 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0435\" width=\"1280\" height=\"786\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/3cd\/93e\/4b5\/3cd93e4b5f53b0c12c9bd0e1e6a272e9.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/3cd\/93e\/4b5\/3cd93e4b5f53b0c12c9bd0e1e6a272e9.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u043d\u0430 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0435<\/figcaption><\/div>\n<\/figure>\n<p><strong>UPD. <\/strong>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 rank1, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c<strong> <\/strong>0,1,2,2,3,4,4,5,6,7,7,8,8,8,8,9,10<\/p>\n<h3>LOUDS \u041f\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430<\/h3>\n<p>RSD \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0434\u043b\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0437\u0430\u0434\u0430\u0447 \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043b\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u043e \u043d\u0430 \u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 succinct \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u043d\u0438\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u0430 \u043f\u043e\u043a\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 &#8212; <strong>Level-Ordered Unary Degree Sequence (LOUDS)<\/strong> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/55b\/066\/bb0\/55b066bb0b223ac85174007ce098be92.png\" alt=\"image.png\" title=\"\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u0430\" width=\"1112\" height=\"356\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/55b\/066\/bb0\/55b066bb0b223ac85174007ce098be92.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/55b\/066\/bb0\/55b066bb0b223ac85174007ce098be92.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u0430<\/figcaption><\/div>\n<\/figure>\n<p>LOUDS \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0438<img decoding=\"async\" class=\"formula inline\" source=\"10\" alt=\"10\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d3\/d3d\/d3d9446802a44259755d38e6d163e820.svg\" width=\"16\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d3\/d3d\/d3d9446802a44259755d38e6d163e820.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d3\/d3d\/d3d9446802a44259755d38e6d163e820.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0445\u043e\u0434 \u0432 \u0448\u0438\u0440\u0438\u043d\u0443 \u0434\u0435\u0440\u0435\u0432\u0430,  \u043f\u0440\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0438 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0441<img decoding=\"async\" class=\"formula inline\" source=\"d\" alt=\"d\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/82\/827\/8277e0910d750195b448797616e091ad.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/82\/827\/8277e0910d750195b448797616e091ad.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/82\/827\/8277e0910d750195b448797616e091ad.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0434\u0435\u0442\u044c\u043c\u0438 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438<img decoding=\"async\" class=\"formula inline\" source=\"d\" alt=\"d\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/82\/827\/8277e0910d750195b448797616e091ad.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/82\/827\/8277e0910d750195b448797616e091ad.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/82\/827\/8277e0910d750195b448797616e091ad.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0435\u0434\u0438\u043d\u0438\u0446 \u0438 \u043e\u0434\u0438\u043d \u043d\u043e\u043b\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u043e \u0438\u0437<img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0432\u0435\u0440\u0448\u0438\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e<img decoding=\"async\" class=\"formula inline\" source=\"n+1\" alt=\"n+1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/40\/40b\/40b85027598d87611b1c8d5d11e46812.svg\" width=\"40\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/40\/40b\/40b85027598d87611b1c8d5d11e46812.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/40\/40b\/40b85027598d87611b1c8d5d11e46812.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043d\u0443\u043b\u0435\u0439 \u0438<img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0435\u0434\u0438\u043d\u0438\u0446. \u0415\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043f\u0440\u043e\u043d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043e\u0431\u0445\u043e\u0434\u043e\u043c \u0432 \u0448\u0438\u0440\u0438\u043d\u0443, \u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Rank\/Select<\/p>\n<ul>\n<li>\n<p>\u0421\u0442\u0435\u043f\u0435\u043d\u044c \u0432\u0435\u0440\u0448\u0438\u043d\u044b<img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b28\/e8d\/f26\/b28e8df26b2fff05f66884a01c9de98b.svg\" width=\"7\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b28\/e8d\/f26\/b28e8df26b2fff05f66884a01c9de98b.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b28\/e8d\/f26\/b28e8df26b2fff05f66884a01c9de98b.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"formula\" source=\"Select_0(i)-Select_0(i-1)\" alt=\"Select_0(i)-Select_0(i-1)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/871\/0e2\/5e1\/8710e25e11b71d789ef717020af189e2.svg\" width=\"221\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/871\/0e2\/5e1\/8710e25e11b71d789ef717020af189e2.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/871\/0e2\/5e1\/8710e25e11b71d789ef717020af189e2.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<ul>\n<li>\n<p>\u041d\u043e\u043c\u0435\u0440<img decoding=\"async\" class=\"formula inline\" source=\"j\" alt=\"j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f49\/46e\/742\/f4946e7425060baabacd420d5d6017e9.svg\" width=\"8\" height=\"19\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f49\/46e\/742\/f4946e7425060baabacd420d5d6017e9.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f49\/46e\/742\/f4946e7425060baabacd420d5d6017e9.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0433\u043e \u0440\u0435\u0431\u0451\u043d\u043a\u0430<img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/26d\/e42\/885\/26de42885c2718b488778e18add24bf8.svg\" width=\"7\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/26d\/e42\/885\/26de42885c2718b488778e18add24bf8.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/26d\/e42\/885\/26de42885c2718b488778e18add24bf8.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0433\u043e \u0443\u0437\u043b\u0430.<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"formula\" source=\"Rank_1(Select_0(i))+j\" alt=\"Rank_1(Select_0(i))+j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f45\/65d\/024\/f4565d024e493650cc5b1fba01dd44fc.svg\" width=\"184\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f45\/65d\/024\/f4565d024e493650cc5b1fba01dd44fc.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f45\/65d\/024\/f4565d024e493650cc5b1fba01dd44fc.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<ul>\n<li>\n<p>\u041d\u043e\u043c\u0435\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f<img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0433\u043e \u0443\u0437\u043b\u0430<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"formula\" source=\"Rank_0(Select_1(i))\" alt=\"Rank_0(Select_1(i))\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/619\/d0c\/5ca\/619d0c5ca0038c096775d85c531d2d4c.svg\" width=\"152\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/619\/d0c\/5ca\/619d0c5ca0038c096775d85c531d2d4c.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/619\/d0c\/5ca\/619d0c5ca0038c096775d85c531d2d4c.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434\u044b \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443\/\u0448\u0438\u0440\u0438\u043d\u0443 \u0438\u043b\u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0435 \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u2014 2 \u0431\u0438\u0442\u0430 \u043d\u0430 \u0443\u0437\u0435\u043b \u043f\u0440\u043e\u0442\u0438\u0432 2-\u0445 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u043c\u0430\u0445\u0438\u043d\u0430\u0446\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f<img decoding=\"async\" class=\"formula inline\" source=\"2\\log_2n\" alt=\"2\\log_2n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b8\/b89\/b8965ce9179fd75881f5443f78469da5.svg\" width=\"56\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b8\/b89\/b8965ce9179fd75881f5443f78469da5.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b8\/b89\/b8965ce9179fd75881f5443f78469da5.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0431\u0438\u0442 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e.<\/p>\n<h3>\u041d\u0430\u0438\u0432\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f RSD<\/h3>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Rank\/Select \u043f\u043e\u0432\u0435\u0440\u0445 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430<img decoding=\"async\" class=\"formula inline\" source=\"B\" alt=\"B\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9d\/9d5\/9d5ed678fe57bcca610140957afab571.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0434\u043b\u0438\u043d\u044b<img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a: \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432<img decoding=\"async\" class=\"formula inline\" source=\"R\" alt=\"R\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e\/e1\/e1e\/e1e1d3d40573127e9ee0480caf1283d6.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e\/e1\/e1e\/e1e1d3d40573127e9ee0480caf1283d6.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/e\/e1\/e1e\/e1e1d3d40573127e9ee0480caf1283d6.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0434\u043b\u0438\u043d\u044b<img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0438 \u0445\u0440\u0430\u043d\u0438\u043c \u0432<img decoding=\"async\" class=\"formula inline\" source=\"S\" alt=\"S\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/5d\/5db\/5dbc98dcc983a70728bd082d1a47546e.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/5d\/5db\/5dbc98dcc983a70728bd082d1a47546e.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/5d\/5db\/5dbc98dcc983a70728bd082d1a47546e.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"R[i]=\\sum_{j=0}^{i-1}B[j]\" alt=\"R[i]=\\sum_{j=0}^{i-1}B[j]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d63\/3c1\/817\/d633c1817bedd1186a3a6e78d60899a2.svg\" width=\"122\" height=\"62\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d63\/3c1\/817\/d633c1817bedd1186a3a6e78d60899a2.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/d63\/3c1\/817\/d633c1817bedd1186a3a6e78d60899a2.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>\u0422\u043e\u0433\u0434\u0430<img decoding=\"async\" class=\"formula inline\" source=\"Rank(i)=R[i]\" alt=\"Rank(i)=R[i]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/bf\/bfb\/bfb70474f05c10bfbb57caea32473ae3.svg\" width=\"112\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/bf\/bfb\/bfb70474f05c10bfbb57caea32473ae3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/bf\/bfb\/bfb70474f05c10bfbb57caea32473ae3.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430<img decoding=\"async\" class=\"formula inline\" source=\"Select(i)\" alt=\"Select(i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/6c\/6c3\/6c3df2e70398be0bca70ca3ce5f6455a.svg\" width=\"64\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/6c\/6c3\/6c3df2e70398be0bca70ca3ce5f6455a.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/6\/6c\/6c3\/6c3df2e70398be0bca70ca3ce5f6455a.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e<img decoding=\"async\" class=\"formula inline\" source=\"R[i]\" alt=\"R[i]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b3\/b33\/b3383ba3de9ec6193c77067d3e6d322e.svg\" width=\"24\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b3\/b33\/b3383ba3de9ec6193c77067d3e6d322e.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b3\/b33\/b3383ba3de9ec6193c77067d3e6d322e.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u043d\u0433 \u0432\u044b \u0443\u043c\u0435\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(1)\" alt=\"\\mathcal{O}(1)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3a\/3ab\/3ab59a4ff434f7e6fa659a319d0c5535.svg\" width=\"32\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3a\/3ab\/3ab59a4ff434f7e6fa659a319d0c5535.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3a\/3ab\/3ab59a4ff434f7e6fa659a319d0c5535.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0441\u0435\u043b\u0435\u043a\u0442 \u0437\u0430<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\log n)\" alt=\"\\mathcal{O}(\\log n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg\" width=\"64\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432<img decoding=\"async\" class=\"formula inline\" source=\"S\" alt=\"S\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/5d\/5db\/5dbc98dcc983a70728bd082d1a47546e.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/5d\/5db\/5dbc98dcc983a70728bd082d1a47546e.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/5d\/5db\/5dbc98dcc983a70728bd082d1a47546e.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u044e\u0442 \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442<img decoding=\"async\" class=\"formula inline\" source=\"0\" alt=\"0\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c\/cf\/cfc\/cfcd208495d565ef66e7dff9f98764da.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c\/cf\/cfc\/cfcd208495d565ef66e7dff9f98764da.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/c\/cf\/cfc\/cfcd208495d565ef66e7dff9f98764da.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0434\u043e<img decoding=\"async\" class=\"formula inline\" source=\"n\" alt=\"n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/7b\/7b8\/7b8b965ad4bca0e41ab51de7b31363a1.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e<img decoding=\"async\" class=\"formula inline\" source=\"n\\log_2n\" alt=\"n\\log_2n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/53\/537\/537bcefbe6dee9f10af3ea8b165e7ddd.svg\" width=\"56\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/53\/537\/537bcefbe6dee9f10af3ea8b165e7ddd.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/53\/537\/537bcefbe6dee9f10af3ea8b165e7ddd.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0431\u0438\u0442.<\/p>\n<h3>Succinct rank<\/h3>\n<p>\u0412 1998 \u042f\u043a\u043e\u0431\u0441\u043e\u043d <a href=\"https:\/\/www.proquest.com\/openview\/1f1b9d0e30bf4a45896aca5e3b164dbb\/1?pq-origsite=gscholar&amp;cbl=18750&amp;diss=y\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443<\/a>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 Rank\/Select \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(1)\" alt=\"\\mathcal{O}(1)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3a\/3ab\/3ab59a4ff434f7e6fa659a319d0c5535.svg\" width=\"32\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3a\/3ab\/3ab59a4ff434f7e6fa659a319d0c5535.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3a\/3ab\/3ab59a4ff434f7e6fa659a319d0c5535.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(n)\" alt=\"\\mathcal{O}(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a6e\/a6e200f05467fb069772a59842a9f43d.svg\" width=\"32\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a6e\/a6e200f05467fb069772a59842a9f43d.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a6e\/a6e200f05467fb069772a59842a9f43d.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0441\u0445\u043e\u0436\u0430 \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0440\u0443\u0441\u0441\u043a\u0438\u0445: \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u0438\u043d\u044b \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435<img decoding=\"async\" class=\"formula inline\" source=\"L=\\frac{1}{2}\\lceil\\log_2n\\rceil\" alt=\"L=\\frac{1}{2}\\lceil\\log_2n\\rceil\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/acb\/518\/bad\/acb518bad786dea5716f2bf208a1bde1.svg\" width=\"121\" height=\"42\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/acb\/518\/bad\/acb518bad786dea5716f2bf208a1bde1.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/acb\/518\/bad\/acb518bad786dea5716f2bf208a1bde1.svg 781w\" loading=\"lazy\" decode=\"async\"\/><em> <\/em>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0431\u0438\u0442 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c. \u0422\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435<img decoding=\"async\" class=\"formula inline\" source=\"2\\times 2^{\\frac{1}{2}\\lceil\\log2n\\rceil}=\\mathcal{O}(\\sqrt{n})\" alt=\"2\\times 2^{\\frac{1}{2}\\lceil\\log2n\\rceil}=\\mathcal{O}(\\sqrt{n})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/98\/983\/9832318591edaf793af51f964782a6c7.svg\" width=\"168\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/98\/983\/9832318591edaf793af51f964782a6c7.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/98\/983\/9832318591edaf793af51f964782a6c7.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u041f\u0443\u0441\u0442\u044c<img decoding=\"async\" class=\"formula inline\" source=\"R_L\" alt=\"R_L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8a\/8ac\/8ac22530e3e2c6104f4e505978190d60.svg\" width=\"16\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8a\/8ac\/8ac22530e3e2c6104f4e505978190d60.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8a\/8ac\/8ac22530e3e2c6104f4e505978190d60.svg 781w\" loading=\"lazy\" decode=\"async\"\/>&#8212; \u0440\u0430\u043d\u0433 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430<img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0434\u043b\u0438\u043d\u044b<img decoding=\"async\" class=\"formula inline\" source=\"L\" alt=\"L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0442.\u0435.<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"R_L[i]=\\sum_{j=0}^{iL-1}B[j]\" alt=\"R_L[i]=\\sum_{j=0}^{iL-1}B[j]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/97c\/906\/0a3\/97c9060a33d55054c525220761fbe800.svg\" width=\"137\" height=\"62\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/97c\/906\/0a3\/97c9060a33d55054c525220761fbe800.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/97c\/906\/0a3\/97c9060a33d55054c525220761fbe800.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>\u0442\u043e\u0433\u0434\u0430 \u0440\u0430\u043d\u0433 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 \u2014 \u0440\u0430\u043d\u0433 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0434\u043b\u0438\u043d\u044b \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435<img decoding=\"async\" class=\"formula inline\" source=\"L\" alt=\"L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg 781w\" loading=\"lazy\" decode=\"async\"\/>.<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"_Rank(k)=R_L\\left[k\/L\\right]+\\sum_{i=L\\times[k\/L]}^{k-1}B[i]\" alt=\"_Rank(k)=R_L\\left[k\/L\\right]+\\sum_{i=L\\times[k\/L]}^{k-1}B[i]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f5b\/ab1\/8d8\/f5bab18d8ce2eebe73f2f61a299bf680.svg\" width=\"292\" height=\"64\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f5b\/ab1\/8d8\/f5bab18d8ce2eebe73f2f61a299bf680.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f5b\/ab1\/8d8\/f5bab18d8ce2eebe73f2f61a299bf680.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u043d\u0433\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\log n)\" alt=\"\\mathcal{O}(\\log n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg\" width=\"64\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0435\u0442\u043e\u043c<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\sqrt{n})\" alt=\"\\mathcal{O}(\\sqrt{n})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8d\/8d9\/8d96f186601712af3d364edcf7caf789.svg\" width=\"48\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8d\/8d9\/8d96f186601712af3d364edcf7caf789.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8d\/8d9\/8d96f186601712af3d364edcf7caf789.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u0434\u043b\u0438\u043d\u044b<img decoding=\"async\" class=\"formula inline\" source=\"L\" alt=\"L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u043c\u0430\u0441\u0441\u0438\u0432<img decoding=\"async\" class=\"formula inline\" source=\"R_L\" alt=\"R_L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/66f\/5f4\/c8e\/66f5f4c8ed93711262dbff8ddb97a9cf.svg\" width=\"26\" height=\"19\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/66f\/5f4\/c8e\/66f5f4c8ed93711262dbff8ddb97a9cf.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/66f\/5f4\/c8e\/66f5f4c8ed93711262dbff8ddb97a9cf.svg 781w\" loading=\"lazy\" decode=\"async\"\/><em> <\/em>\u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443<img decoding=\"async\" class=\"formula inline\" source=\"n\/L\" alt=\"n\/L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/51\/516\/51624937bb7dc2318ce2b0b00031e1a5.svg\" width=\"32\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/51\/516\/51624937bb7dc2318ce2b0b00031e1a5.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/51\/516\/51624937bb7dc2318ce2b0b00031e1a5.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\log n)\" alt=\"\\mathcal{O}(\\log n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg\" width=\"64\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 781w\" loading=\"lazy\" decode=\"async\"\/><em> <\/em>\u0431\u0438\u0442 \u2014 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(n)\" alt=\"\\mathcal{O}(n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a6e\/a6e200f05467fb069772a59842a9f43d.svg\" width=\"32\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a6e\/a6e200f05467fb069772a59842a9f43d.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a6\/a6e\/a6e200f05467fb069772a59842a9f43d.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043a\u0430 \u0435\u0449\u0435 \u043d\u0435 succinct. \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f succinct \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B5%D0%BB%D1%8C%D1%82%D0%B0-%D0%BA%D0%BE%D0%B4%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u043b\u044c\u0442\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/www.antoniomallia.it\/sorted-integers-compression-with-elias-fano-encoding.html\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u042d\u043b\u0438\u0430\u0441\u0430-\u0424\u0430\u043d\u043e<\/a> \u0434\u043b\u044f \u0441\u0436\u0430\u0442\u0438\u044f \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u042f\u043a\u043e\u0431\u0441\u043e\u043d \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u044f\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u041a \u0431\u043b\u043e\u043a\u0430\u043c \u0434\u043b\u0438\u043d\u044b<img decoding=\"async\" class=\"formula inline\" source=\"L\" alt=\"L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/d\/d2\/d20\/d20caec3b48a1eef164cb4ca81ba2587.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0438 \u0434\u043b\u0438\u043d\u044b<img decoding=\"async\" class=\"formula inline\" source=\"K=\\lceil\\log_2^2n\\rceil\" alt=\"K=\\lceil\\log_2^2n\\rceil\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7a\/4b1\/c6b\/b7a4b1c6b8e73abd9c5c9a21629da496.svg\" width=\"108\" height=\"25\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7a\/4b1\/c6b\/b7a4b1c6b8e73abd9c5c9a21629da496.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/b7a\/4b1\/c6b\/b7a4b1c6b8e73abd9c5c9a21629da496.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u0422\u0435\u043f\u0435\u0440\u044c, \u0440\u0430\u043d\u0433 \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0430, \u0430 \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0445\u0440\u0430\u043d\u0438\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u043d\u0433, \u0442.\u0435. \u0440\u0430\u043d\u0433 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c\u0443 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0443. \u0414\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u043d\u0433\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u0442\u044c<img decoding=\"async\" class=\"formula inline\" source=\"\\lceil\\log_2^2n\\rceil\" alt=\"\\lceil\\log_2^2n\\rceil\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/236\/ddd\/2e9\/236ddd2e9e43424ac1ca5aace54e6932.svg\" width=\"65\" height=\"25\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/236\/ddd\/2e9\/236ddd2e9e43424ac1ca5aace54e6932.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/236\/ddd\/2e9\/236ddd2e9e43424ac1ca5aace54e6932.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e<img decoding=\"async\" class=\"formula inline\" source=\"\\lceil 2\\log_2\\log_2n \\rceil\" alt=\"\\lceil 2\\log_2\\log_2n \\rceil\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eda\/01a\/b36\/eda01ab369e0bca5e307ee181f31e0e4.svg\" width=\"115\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eda\/01a\/b36\/eda01ab369e0bca5e307ee181f31e0e4.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/eda\/01a\/b36\/eda01ab369e0bca5e307ee181f31e0e4.svg 781w\" loading=\"lazy\" decode=\"async\"\/>\u0431\u0438\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c<\/p>\n<ul>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}\\left(\\frac{n}{\\log n}\\right)\" alt=\"\\mathcal{O}\\left(\\frac{n}{\\log n}\\right)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b0\/3a0\/579\/7b03a05794ff7ab18af31c337487e853.svg\" width=\"93\" height=\"49\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b0\/3a0\/579\/7b03a05794ff7ab18af31c337487e853.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7b0\/3a0\/579\/7b03a05794ff7ab18af31c337487e853.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u043d\u0433\u043e\u0432 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u043e\u0432<img decoding=\"async\" class=\"formula inline\" source=\"R_K\" alt=\"R_K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8e\/8eb\/8ebe43b6acbce713aacfdcf87829ab7f.svg\" width=\"24\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8e\/8eb\/8ebe43b6acbce713aacfdcf87829ab7f.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8e\/8eb\/8ebe43b6acbce713aacfdcf87829ab7f.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<\/li>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\sqrt{n})\" alt=\"\\mathcal{O}(\\sqrt{n})\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b2\/964\/f90\/8b2964f901c63b7617562d9e23b6ce9c.svg\" width=\"58\" height=\"23\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b2\/964\/f90\/8b2964f901c63b7617562d9e23b6ce9c.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/8b2\/964\/f90\/8b2964f901c63b7617562d9e23b6ce9c.svg 781w\" loading=\"lazy\" decode=\"async\"\/>\u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432<\/p>\n<\/li>\n<li>\n<p><img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}\\left(\\frac{n\\log\\log n}{\\log n}\\right)\" alt=\"\\mathcal{O}\\left(\\frac{n\\log\\log n}{\\log n}\\right)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6d5\/e1d\/14a\/6d5e1d14a12164431ff30d61a99b1f4c.svg\" width=\"136\" height=\"49\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6d5\/e1d\/14a\/6d5e1d14a12164431ff30d61a99b1f4c.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/6d5\/e1d\/14a\/6d5e1d14a12164431ff30d61a99b1f4c.svg 781w\" loading=\"lazy\" decode=\"async\"\/>\u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u043d\u0433\u043e\u0432<img decoding=\"async\" class=\"formula inline\" source=\"R_L\" alt=\"R_L\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8a\/8ac\/8ac22530e3e2c6104f4e505978190d60.svg\" width=\"16\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8a\/8ac\/8ac22530e3e2c6104f4e505978190d60.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8a\/8ac\/8ac22530e3e2c6104f4e505978190d60.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<\/li>\n<\/ul>\n<p>\u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439<\/p>\n<p><img decoding=\"async\" class=\"formula\" source=\"Rank(k)=R_K[k\/K]+R_L\\left[k\/L\\right]+\\sum_{i=L\\times[n\/L]}^{n-1}B[i]\" alt=\"Rank(k)=R_K[k\/K]+R_L\\left[k\/L\\right]+\\sum_{i=L\\times[n\/L]}^{n-1}B[i]\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db6\/f9a\/e3f\/db6f9ae3f5f19e7472cba99852e846ed.svg\" width=\"396\" height=\"64\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db6\/f9a\/e3f\/db6f9ae3f5f19e7472cba99852e846ed.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/db6\/f9a\/e3f\/db6f9ae3f5f19e7472cba99852e846ed.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/447\/c64\/062\/447c640623ba3c518d17e9c01d7f60df.gif\" alt=\"\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0440\u0430\u043d\u0433\u0430: \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u043d\u0433\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u044b, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0442\u043e\u0436\u0435, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\" title=\"\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0440\u0430\u043d\u0433\u0430: \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u043d\u0433\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u044b, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0442\u043e\u0436\u0435, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\" width=\"800\" height=\"450\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/447\/c64\/062\/447c640623ba3c518d17e9c01d7f60df.gif 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/447\/c64\/062\/447c640623ba3c518d17e9c01d7f60df.gif 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0440\u0430\u043d\u0433\u0430: \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u043d\u0433\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u044b, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0442\u043e\u0436\u0435, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<h3>Succinct select<\/h3>\n<p>\u041e\u043f\u0438\u0448\u0443 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0435\u043b\u0435\u043a\u0442\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0441\u0438\u043c\u043f\u0442\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}((\\log\\log n)^2)\" alt=\"\\mathcal{O}((\\log\\log n)^2)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fe\/feb\/feb9ebf3a41987c1cd7f292a3e6211b8.svg\" width=\"112\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fe\/feb\/feb9ebf3a41987c1cd7f292a3e6211b8.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/f\/fe\/feb\/feb9ebf3a41987c1cd7f292a3e6211b8.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(1)\" alt=\"\\mathcal{O}(1)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3a\/3ab\/3ab59a4ff434f7e6fa659a319d0c5535.svg\" width=\"32\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3a\/3ab\/3ab59a4ff434f7e6fa659a319d0c5535.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3a\/3ab\/3ab59a4ff434f7e6fa659a319d0c5535.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0439. \u0418\u0442\u0430\u043a, 3 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 \u0434\u043b\u044f \u0441\u0435\u043b\u0435\u043a\u0442<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0440\u0430\u043d\u0433\u043e\u043c \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u0434\u043b\u0438\u043d\u044b \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435<img decoding=\"async\" class=\"formula inline\" source=\"L=\\frac{1}{2}\\log_2 n\" alt=\"L=\\frac{1}{2}\\log_2 n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe8\/193\/026\/fe81930265b2820fe58ff9bc9d0dee46.svg\" width=\"104\" height=\"42\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe8\/193\/026\/fe81930265b2820fe58ff9bc9d0dee46.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/fe8\/193\/026\/fe81930265b2820fe58ff9bc9d0dee46.svg 781w\" loading=\"lazy\" decode=\"async\"\/><em> \u043c\u043e\u0436\u043d\u043e <\/em>\u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0442\u0430\u043a\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0440\u0430\u043d\u0433\u0430 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435<img decoding=\"async\" class=\"formula inline\" source=\"0\\ldots L-1\" alt=\"0\\ldots L-1\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/57\/571\/571bbf23d5eae7838edf04f971f9c159.svg\" width=\"72\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/57\/571\/571bbf23d5eae7838edf04f971f9c159.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/57\/571\/571bbf23d5eae7838edf04f971f9c159.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0438\u0437 \u0447\u0435\u0433\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\sqrt{n}\\log_2 n)\" alt=\"\\mathcal{O}(\\sqrt{n}\\log_2 n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef2\/821\/691\/ef2821691c41f73ecf4e5075fbd8d51f.svg\" width=\"109\" height=\"23\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef2\/821\/691\/ef2821691c41f73ecf4e5075fbd8d51f.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/ef2\/821\/691\/ef2821691c41f73ecf4e5075fbd8d51f.svg 781w\" loading=\"lazy\" decode=\"async\"\/>.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u043e\u0442\u043c\u0435\u0447\u0430\u043b\u043e\u0441\u044c, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u043d\u0433\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0441\u0435\u043b\u0435\u043a\u0442\u0430. \u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f  \u0441\u0442\u043e\u0438\u0442<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(S)\" alt=\"\\mathcal{O}(S)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9b\/9bd\/9bd9f67af118fb2dc66c4c242222eb00.svg\" width=\"40\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9b\/9bd\/9bd9f67af118fb2dc66c4c242222eb00.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9b\/9bd\/9bd9f67af118fb2dc66c4c242222eb00.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u044b<img decoding=\"async\" class=\"formula inline\" source=\"S\" alt=\"S\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/5d\/5db\/5dbc98dcc983a70728bd082d1a47546e.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/5d\/5db\/5dbc98dcc983a70728bd082d1a47546e.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/5\/5d\/5db\/5dbc98dcc983a70728bd082d1a47546e.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0440\u0430\u043d\u0433\u0430\u0445 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u043e\u0432 \u0441\u0442\u043e\u0438\u0442<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\log n)\" alt=\"\\mathcal{O}(\\log n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg\" width=\"64\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\log n)\" alt=\"\\mathcal{O}(\\log n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg\" width=\"64\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/94\/943\/943914203be642543a04f6155c428123.svg 781w\" loading=\"lazy\" decode=\"async\"\/>\u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439. \u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u0445 \u0441\u0442\u043e\u0438\u0442<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\log\\log n)\" alt=\"\\mathcal{O}(\\log\\log n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/74\/74a\/74ad3a2ce4e00bd1065a5fd166592c17.svg\" width=\"88\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/74\/74a\/74ad3a2ce4e00bd1065a5fd166592c17.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/7\/74\/74a\/74ad3a2ce4e00bd1065a5fd166592c17.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442<img decoding=\"async\" class=\"formula inline\" source=\"\\mathcal{O}(\\log \\log n)\" alt=\"\\mathcal{O}(\\log \\log n)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/17\/173\/173c92838fe3e520055e2162c18a488f.svg\" width=\"88\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/17\/173\/173c92838fe3e520055e2162c18a488f.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/1\/17\/173\/173c92838fe3e520055e2162c18a488f.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0430\u0445 \u0434\u043e\u0440\u043e\u0433\u043e\u0439, \u043d\u043e \u043e\u0442 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e<img decoding=\"async\" class=\"formula inline\" source=\"K\" alt=\"K\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a5\/a5f\/a5f3c6a11b03839d46af9fb43c97c188.svg\" width=\"16\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a5\/a5f\/a5f3c6a11b03839d46af9fb43c97c188.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/a\/a5\/a5f\/a5f3c6a11b03839d46af9fb43c97c188.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u0430. \u0415\u0441\u043b\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c<img decoding=\"async\" class=\"formula inline\" source=\"S_K(i)=Select(iK)\" alt=\"S_K(i)=Select(iK)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a23\/cbe\/372\/a23cbe3726c99b1b4d1426d8b87f0f37.svg\" width=\"164\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a23\/cbe\/372\/a23cbe3726c99b1b4d1426d8b87f0f37.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/a23\/cbe\/372\/a23cbe3726c99b1b4d1426d8b87f0f37.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0442\u043e<\/p>\n<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"formula\" source=\"S_K(\\lfloor i\/K \\rfloor)\\leq Select(i)&lt;S_K(\\lfloor i\/K\\rfloor + 1)\" alt=\"S_K(\\lfloor i\/K \\rfloor)\\leq Select(i)&lt;S_K(\\lfloor i\/K\\rfloor + 1)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7af\/024\/2e3\/7af0242e38199235d85870fb16c3337a.svg\" width=\"341\" height=\"22\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7af\/024\/2e3\/7af0242e38199235d85870fb16c3337a.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/7af\/024\/2e3\/7af0242e38199235d85870fb16c3337a.svg 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<p>\u041e\u043f\u0443\u0441\u043a\u0430\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f55\/443\/86b\/f5544386bf218e48198ebaed90b71122.gif\" alt=\"\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0441\u0435\u043b\u0435\u043a\u0442\u0430: \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043b\u0443\u0447\u0448\u0435, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0439\" title=\"\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0441\u0435\u043b\u0435\u043a\u0442\u0430: \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043b\u0443\u0447\u0448\u0435, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0439\" width=\"800\" height=\"450\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f55\/443\/86b\/f5544386bf218e48198ebaed90b71122.gif 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/f55\/443\/86b\/f5544386bf218e48198ebaed90b71122.gif 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0441\u0435\u043b\u0435\u043a\u0442\u0430: \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043b\u0443\u0447\u0448\u0435, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0439<\/figcaption><\/div>\n<\/figure>\n<h3>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u0436\u0435\u043b\u0435\u0437\u0443, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 CPU<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0439<img decoding=\"async\" class=\"formula inline\" source=\"n\\leq 2^{64}\" alt=\"n\\leq 2^{64}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/40\/40a\/40ad86b1483c049d7ebae6590bbf95fa.svg\" width=\"56\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/40\/40a\/40ad86b1483c049d7ebae6590bbf95fa.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/4\/40\/40a\/40ad86b1483c049d7ebae6590bbf95fa.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e,<img decoding=\"async\" class=\"formula inline\" source=\"\\log_2n\\leq 64\" alt=\"\\log_2n\\leq 64\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0c0\/1cb\/178\/0c01cb1783a0819c10e1e2805c02e5c6.svg\" width=\"93\" height=\"21\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0c0\/1cb\/178\/0c01cb1783a0819c10e1e2805c02e5c6.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/0c0\/1cb\/178\/0c01cb1783a0819c10e1e2805c02e5c6.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0434<img decoding=\"async\" class=\"formula inline\" source=\"\\log_2 n\" alt=\"\\log_2 n\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/71a\/12b\/8f7\/71a12b8f79bb1767c8d82ae36b68c3ea.svg\" width=\"48\" height=\"21\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/71a\/12b\/8f7\/71a12b8f79bb1767c8d82ae36b68c3ea.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/71a\/12b\/8f7\/71a12b8f79bb1767c8d82ae36b68c3ea.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0431\u0438\u0442\u0430\u043c\u0438 \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043f\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0434 1 \u0431\u0438\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430<img decoding=\"async\" class=\"formula inline\" source=\"\\sqrt{n}\" alt=\"\\sqrt{n}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/be\/be1\/be183cdd1e68ce30a59b96233609b08f.svg\" width=\"24\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/be\/be1\/be183cdd1e68ce30a59b96233609b08f.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/be\/be1\/be183cdd1e68ce30a59b96233609b08f.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0432\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u0432 L1 \u043a\u044d\u0448, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u0438 \u0432 L2\/L3. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e Broadword programming\/SWAR (\u0441\u043c. \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/habr.com\/ru\/articles\/886182\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>) \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0449\u0435 \u043f\u0440\u043e \u043a\u044d\u0448\u0438: \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f 2-3 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u0432\u0435\u0440\u0445 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u044d\u0448 \u043f\u0440\u043e\u043c\u0430\u0445\u043e\u0432 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0431\u043e\u0442\u0442\u043b\u043d\u0435\u043a\u043e\u043c \u0438 \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u043a\u044d\u0448 \u043b\u0438\u043d\u0438\u0438, \u0442.\u0435. 64 \u0431\u0430\u0439\u0442\/512 \u0431\u0438\u0442 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 CPU. \u0415\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0430\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 &#8212; interleaving, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u0445 \u0438\u043b\u0438 \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0438 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 POPCNT, TZCNT \u0438 PDEP \u0438 \u0438\u0445 SIMD \u0432\u0435\u0440\u0441\u0438\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u2014 \u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 \u0432 \u0447\u0438\u0441\u043b\u0435, \u0432\u0442\u043e\u0440\u0430\u044f &#8212; \u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u043f\u0435\u0440\u0432\u044b\u0445 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0438\u0442, \u0442\u0440\u0435\u0442\u044c\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043e\u043f\u0438\u0448\u0443 \u043f\u043e\u0437\u0436\u0435. \u0420\u0430\u043d\u0433 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e 512 \u0431\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e POPCNT, \u0441\u0435\u043b\u0435\u043a\u0442 \u0442\u0430\u043a\u0436\u0435 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e 512 \u0431\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PDEP+TZCNT. POPCNT \u0438 TZCNT \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/utility\/bit.html\" rel=\"noopener noreferrer nofollow\">\u0421++20<\/a>, \u0430 \u0432\u043e\u0442 c PDEP \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0430\u0441\u0435\u043d\u0438\u044f \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 AVX-512, \u043a\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u043a\u043e\u0432\u0430\u043d \u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0435, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u043d\u0430 512 \u0431\u0438\u0442\u0430\u0445<\/h3>\n<p>SIMD within a register(SWAR)\/broadword programming \u2014 \u0442\u0435\u0440\u043c\u0438\u043d\u044b \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u041a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 <a href=\"https:\/\/godbolt.org\/z\/xrYMP5KbG\" rel=\"noopener noreferrer nofollow\">\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432<\/a> \u0432 \u0446\u0435\u043b\u043e\u043c \u0447\u0438\u0441\u043b\u0435 (\u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u043d\u0433\u0430)<\/p>\n<pre><code class=\"cpp\">uint64_t popcount64(uint64_t x) {     x = x - ((x &gt;&gt; 1) &amp; 0x5555555555555555ULL);                    x = (x &amp; 0x3333333333333333ULL) + ((x &gt;&gt; 2) &amp; 0x3333333333333333ULL);     x = (x + (x &gt;&gt; 4)) &amp; 0x0F0F0F0F0F0F0F0FULL;                    x = x * 0x0101010101010101ULL;                                 return x &gt;&gt; 56;                                            } <\/code><\/pre>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e POPCNT, \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043e\u043d\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043d \u0438\u0437 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432. C SIMD \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430 \u043d\u044e\u0430\u043d\u0441\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c popcount \u043f\u0435\u0440\u0432\u044b\u0445 <code>count<\/code> \u0431\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043a\u043e\u0435<em>:<\/em><\/p>\n<pre><code class=\"cpp\">uint64_t rank_64(uint64_t x, uint64_t count) {   \/\/ \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u0438 count &gt;= 64 1ull &lt;&lt; count -- \u044d\u0442\u043e UB   \/\/ \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0440\u043e\u0433\u0430\u044f \u0438 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435   \/\/ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430   return std::popcount(x &amp; ((1ull &lt;&lt; count) - 1)); } <\/code><\/pre>\n<p>SIMD \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>mmXpopcnt_epi64<\/code>\u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b +  <code>mmXreduce_add_epi64<\/code>\u0434\u043b\u044f \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0418 \u0442\u0443\u0442 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u043c\u0430\u0441\u043a\u0438 <code>((1 &lt;&lt; count) - 1))<\/code>\u0434\u043b\u044f <code>count \u2265 64<\/code>\u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041e\u0434\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f <code>count=8k<\/code>, \u043d\u043e \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 8 \u0431\u0438\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c, \u043b\u0443\u0447\u0448\u0435\u0435 \u0447\u0442\u043e \u044f \u043d\u0430\u0448\u0435\u043b &#8212;  \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <code>shldv(a, b, k)<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0435\u0440\u0451\u0442 \u0434\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0441\u0435\u043b a, b \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441, \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 &#8212; \u044d\u0442\u043e k \u0432\u0435\u0440\u0445\u043d\u0438\u0445 \u0431\u0438\u0442 b \u0438 (x-k) \u043c\u043b\u0430\u0434\u0448\u0438\u0445 \u0431\u0438\u0442 a, \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435<\/p>\n<pre><code class=\"cpp\">uint64_t rank_512(uint64_t *x, uint64_t count) {   __m512i a = _mm512_maskz_set1_epi64((1ull &lt;&lt; ((count &gt;&gt; 6))) - 1,                                       std::numeric_limits&lt;uint64_t&gt;::max());   __m512i b = _mm512_maskz_set1_epi64((1ull &lt;&lt; ((count &gt;&gt; 6) + 1)) - 1,                                       std::numeric_limits&lt;uint64_t&gt;::max());   __m512i mask = _mm512_shldv_epi64(a, b, _mm512_set1_epi64(count % 64));    __m512i res = _mm512_load_epi64(x);   res = _mm512_and_epi64(res, mask);   __m512i cnt = _mm512_popcnt_epi64(res);   return _mm512_reduce_add_epi64(cnt); }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u0435\u0441\u0442\u044c SWAR \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u043d\u0433\u0430 \u0438 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430, \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0435\u0441\u0442\u044c <a href=\"http:\/\/www-graphics.stanford.edu\/~seander\/bithacks.html#SelectPosFromMSBRank\" rel=\"noopener noreferrer nofollow\">\u0432\u043e\u0442 \u0442\u0443\u0442<\/a>. \u041f\u043e \u0441\u0443\u0442\u0438 \u043c\u044b \u043f\u0440\u043e\u0441\u0442\u043e \u0434\u0435\u043b\u0430\u0435\u043c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e \u0440\u0430\u043d\u0433\u0443, \u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 popcount, \u043d\u043e \u043c\u043e\u0436\u043d\u043e \u0438 \u043f\u0440\u043e\u0449\u0435 (\u043d\u043e \u043d\u0435 \u0444\u0430\u043a\u0442, \u0447\u0442\u043e \u0431\u044b\u0441\u0442\u0440\u0435\u0435). \u0412 SWAR \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0435 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 \u043d\u0430 \u043f\u0440\u043e\u043c\u0435\u0436\u0443\u0442\u043e\u0447\u043d\u044b\u0445 \u0448\u0430\u0433\u0430\u0445 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0441\u0443\u043c\u043c\u044b \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0440\u0430\u0437\u043c\u0435\u0440\u0430<img decoding=\"async\" class=\"formula inline\" source=\"2^i\" alt=\"2^i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/91\/91c\/91c474acddeedae9e86913ee8bb17ce0.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/91\/91c\/91c474acddeedae9e86913ee8bb17ce0.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/91\/91c\/91c474acddeedae9e86913ee8bb17ce0.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0435\u0441\u043b\u0438 \u0441\u043e\u0445\u0440\u0430\u043d\u0438\u0442\u044c \u044d\u0442\u0443 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e, \u0442\u043e \u043d\u0430<img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0430\u043c \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u043f\u043e \u0431\u043b\u043e\u043a\u0430\u043c \u0440\u0430\u0437\u043c\u0435\u0440\u0430<img decoding=\"async\" class=\"formula inline\" source=\"2^{6-i}\" alt=\"2^{6-i}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b7\/b7d\/b7dd26676a4c9a1bb9bb4f093e454ad6.svg\" width=\"24\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b7\/b7d\/b7dd26676a4c9a1bb9bb4f093e454ad6.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/b\/b7\/b7d\/b7dd26676a4c9a1bb9bb4f093e454ad6.svg 781w\" loading=\"lazy\" decode=\"async\"\/> (\u0434\u043b\u044f 64-\u0431\u0438\u0442\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430). \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0438\u0437 10 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0445 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u0441\u0430\u043c\u0438 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0438 \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044f\u0442\u0441\u044f.<\/p>\n<p>\u041a\u0430\u043a \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0441\u0435\u043b\u0435\u043a\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0435\u0440\u0435\u0437 2 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0435 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438:<\/p>\n<ul>\n<li>\n<p><strong>Parallel bit deposit (PDEP)<\/strong>: \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u0434\u0432\u0430 \u0430\u0440\u0433\u0443\u043c\u0435\u043d\u0442\u0430 <code>x, mask<\/code>. \u0414\u043e\u043f\u0443\u0441\u0442\u0438\u043c, \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0435 \u0431\u0438\u0442\u044b <code>mask<\/code> \u043d\u0430\u0445\u043e\u0434\u044f\u0442\u0441\u044f \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445<img decoding=\"async\" class=\"formula inline\" source=\"i_1, i_2, \\ldots, i_k\" alt=\"i_1, i_2, \\ldots, i_k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/095\/e35\/b12\/095e35b122fc3f2c52f4642db0dd0a1e.svg\" width=\"98\" height=\"19\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/095\/e35\/b12\/095e35b122fc3f2c52f4642db0dd0a1e.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/095\/e35\/b12\/095e35b122fc3f2c52f4642db0dd0a1e.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, PDEP \u0431\u0435\u0440\u0451\u0442 \u043f\u0435\u0440\u0432\u044b\u0435<img decoding=\"async\" class=\"formula inline\" source=\"k\" alt=\"k\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/8c\/8ce\/8ce4b16b22b58894aa86c421e8759df3.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0431\u0438\u0442 <code>x<\/code>\u0438 \u0440\u0430\u0441\u043f\u043e\u043b\u0430\u0433\u0430\u0435\u0442 \u0438\u0445 \u043d\u0430 \u044d\u0442\u0438\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e <a href=\"https:\/\/en.wikipedia.org\/wiki\/X86_Bit_manipulation_instruction_set#BMI2_(Bit_Manipulation_Instruction_Set_2)\" rel=\"noopener noreferrer nofollow\">BMI2<\/a><\/p>\n<\/li>\n<li>\n<p><strong>Count trailing zeros (TZCNT):<\/strong> \u044d\u0442\u043e \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u0430\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043c\u043b\u0430\u0434\u0448\u0438\u0445 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0438\u0442 \u0438\u043b\u0438, \u0447\u0442\u043e \u0442\u043e\u0436\u0435 \u0441\u0430\u043c\u043e\u0435, \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u0430. \u041d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u0421++20 \u044d\u0442\u043e <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/numeric\/countr_zero.html\" rel=\"noopener noreferrer nofollow\">std::countr_zero<\/a>.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421\u0435\u043b\u0435\u043a\u0442 \u0432\u044b\u0440\u0430\u0436\u0430\u0435\u0442\u0441\u044f \u043e\u0447\u0435\u043d\u044c \u043f\u0440\u043e\u0441\u0442\u043e \u0447\u0435\u0440\u0435\u0437 \u044d\u0442\u0438 \u0434\u0432\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 (\u0438 \u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u0441\u0434\u0432\u0438\u0433)<\/p>\n<pre><code class=\"cpp\">size_t select64(uint64_t x, size_t rank) {   return _tzcnt_u64(_pdep_u64(1ull &lt;&lt; rank, x)); } <\/code><\/pre>\n<figure class=\"full-width\"><img decoding=\"async\" src=\"https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/18f\/f26\/46d\/18ff2646d35dce7bfbaa57db3a034f90.png\" alt=\"image.png\" title=\"Parallel bit deposit \u0431\u0435\u0440\u0435\u0442 \u0431\u0438\u0442\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0438 \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u043c \u0431\u0438\u0442\u0430\u043c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430\" width=\"1144\" height=\"643\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/r\/w780\/getpro\/habr\/upload_files\/18f\/f26\/46d\/18ff2646d35dce7bfbaa57db3a034f90.png 780w,&#10;       https:\/\/habrastorage.org\/r\/w1560\/getpro\/habr\/upload_files\/18f\/f26\/46d\/18ff2646d35dce7bfbaa57db3a034f90.png 781w\" loading=\"lazy\" decode=\"async\"\/><\/p>\n<div><figcaption>Parallel bit deposit \u0431\u0435\u0440\u0435\u0442 \u0431\u0438\u0442\u044b \u043e\u0434\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0438 \u0440\u0430\u0441\u043a\u043b\u0430\u0434\u044b\u0432\u0430\u0435\u0442 \u0438\u0445 \u043f\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u043c \u0431\u0438\u0442\u0430\u043c \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430<\/figcaption><\/div>\n<\/figure>\n<h3>\u041f\u043e\u0438\u0441\u043a \u043d\u0443\u0436\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430<\/h3>\n<p>\u0421 \u0440\u0430\u043d\u0433\u043e\u043c \u0442\u0435\u043e\u0440\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u043a\u043e\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0432\u043f\u043e\u043b\u043d\u0435 \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u043d\u043e\u0439, \u0434\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0430\u043c \u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0430 \u043e\u0434\u043d\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430, \u043f\u043e\u043c\u0435\u0449\u0430\u044e\u0449\u0435\u0433\u043e\u0441\u044f \u0432 \u043a\u044d\u0448 \u043b\u0438\u043d\u0438\u044e. \u0410 \u0432\u043e\u0442 \u0441 \u0441\u0435\u043b\u0435\u043a\u0442\u043e\u043c \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u044f \u0441\u043b\u043e\u0436\u043d\u0435\u0435 \u0442\u0430\u043a \u043a\u0430\u043a \u043c\u044b \u043d\u0435 \u043c\u043e\u0436\u0435\u043c \u0433\u0430\u0440\u0430\u043d\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u0444\u0438\u043a\u0441\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0434\u0435\u0439\u0441\u0442\u0432\u0438\u0439, \u0442\u0430\u043a \u0438\u043b\u0438 \u0438\u043d\u0430\u0447\u0435 \u0434\u043e\u043b\u0436\u0435\u043d \u0431\u044b\u0442\u044c \u0437\u0430\u0434\u0435\u0439\u0441\u0442\u0432\u043e\u0432\u0430\u043d \u043a\u0430\u043a\u043e\u0439-\u043b\u0438\u0431\u043e \u043f\u043e\u0438\u0441\u043a. \u0412\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0442\u0443\u0442 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e:<\/p>\n<ul>\n<li>\n<p>\u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a: \u0445\u043e\u0440\u043e\u0448\u043e \u0432 \u0442\u0435\u043e\u0440\u0438\u0438, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043d\u0435 \u043e\u0447\u0435\u043d\u044c \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439 \u043d\u0435 \u0442\u0430\u043a \u043c\u043d\u043e\u0433\u043e, \u0430 \u0441\u043a\u0430\u043a\u0430\u0442\u044c \u043f\u043e \u0440\u0430\u0437\u043d\u044b\u043c \u0443\u0447\u0430\u0441\u0442\u043a\u0430\u043c \u043f\u0430\u043c\u044f\u0442\u0438 \u043d\u0435 \u0432\u044b\u0433\u043e\u0434\u043d\u043e \u043f\u043e \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0441\u0442\u0438<\/p>\n<\/li>\n<li>\n<p>\u041b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a: \u043f\u043b\u043e\u0445\u043e \u0432 \u0442\u0435\u043e\u0440\u0438\u0438, \u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435, \u0445\u043e\u0440\u043e\u0448\u043e \u0443\u0441\u043a\u043e\u0440\u044f\u0435\u0442\u0441\u044f SIMD \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f\u043c\u0438<\/p>\n<\/li>\n<li>\n<p>\u0418\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a: \u0435\u0441\u043b\u0438 \u043c\u044b \u0437\u043d\u0430\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e<img decoding=\"async\" class=\"formula inline\" source=\"i\" alt=\"i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/8\/86\/865\/865c0c0b4ab0e063e5caa3387c1a8741.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0433\u043e \u0431\u0438\u0442\u0430<img decoding=\"async\" class=\"formula inline\" source=\"p_i\" alt=\"p_i\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a6\/fa1\/dd8\/4a6fa1dd827e77cf2206f24e7c024ec7.svg\" width=\"17\" height=\"15\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a6\/fa1\/dd8\/4a6fa1dd827e77cf2206f24e7c024ec7.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/4a6\/fa1\/dd8\/4a6fa1dd827e77cf2206f24e7c024ec7.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0438<img decoding=\"async\" class=\"formula inline\" source=\"j\" alt=\"j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/36\/363\/363b122c528f54df4a0446b6bab05515.svg\" width=\"12\" height=\"12\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/36\/363\/363b122c528f54df4a0446b6bab05515.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/36\/363\/363b122c528f54df4a0446b6bab05515.svg 781w\" loading=\"lazy\" decode=\"async\"\/>-\u043e\u0433\u043e \u0431\u0438\u0442\u0430<img decoding=\"async\" class=\"formula inline\" source=\"p_j\" alt=\"p_j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c91\/a27\/5ab\/c91a275ab54a6ff7ae1405c9d67101f5.svg\" width=\"18\" height=\"17\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c91\/a27\/5ab\/c91a275ab54a6ff7ae1405c9d67101f5.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/c91\/a27\/5ab\/c91a275ab54a6ff7ae1405c9d67101f5.svg 781w\" loading=\"lazy\" decode=\"async\"\/>, \u0430 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u0435 \u0435\u0434\u0438\u043d\u0438\u0446 \u043f\u043e\u0447\u0442\u0438 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0435, \u0442\u043e\u0433\u0434\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044e<img decoding=\"async\" class=\"formula inline\" source=\"i\\leq k \\leq j\" alt=\"i\\leq k \\leq j\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9b\/9bc\/9bccd4b5cf4a8d5200ab34d698db96f7.svg\" width=\"64\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9b\/9bc\/9bccd4b5cf4a8d5200ab34d698db96f7.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/9\/9b\/9bc\/9bccd4b5cf4a8d5200ab34d698db96f7.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0438\u0431\u043b\u0438\u0437\u0438\u0442\u044c \u043a\u0430\u043a<img decoding=\"async\" class=\"formula inline\" source=\"p_k=p_i+(p_j-p_i)(k-i)\/(j-i)\" alt=\"p_k=p_i+(p_j-p_i)(k-i)\/(j-i)\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/992\/812\/738\/992812738563e907a1f5ebc6c3bfb0d2.svg\" width=\"275\" height=\"23\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/992\/812\/738\/992812738563e907a1f5ebc6c3bfb0d2.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/upload_files\/992\/812\/738\/992812738563e907a1f5ebc6c3bfb0d2.svg 781w\" loading=\"lazy\" decode=\"async\"\/>. <\/p>\n<\/li>\n<\/ul>\n<p>\u041a\u0430\u043a \u043e\u0442\u043c\u0435\u0447\u0430\u044e\u0442 \u0432 \u0441\u0442\u0430\u0442\u044c\u044f\u0445 \u0435\u0441\u043b\u0438 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u0435, \u0442\u043e \u043a\u043b\u044e\u0447\u0435\u0432\u044b\u043c \u0444\u0430\u043a\u0442\u043e\u0440\u043e\u043c \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u044d\u0448 \u043f\u0440\u043e\u043c\u0430\u0445\u043e\u0432. \u0414\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u043c\u043e\u0436\u043d\u043e \u043e\u0436\u0438\u0434\u0430\u0442\u044c, \u0447\u0442\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u0437\u0430\u043f\u0440\u043e\u0441 \u043a \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u2014 \u044d\u0442\u043e \u043a\u044d\u0448 \u043f\u0440\u043e\u043c\u0430\u0445, \u043d\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u043a\u044d\u0448 \u043b\u0438\u043d\u0438\u044f 512 \u0431\u0438\u0442, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0435\u0441\u0442\u044c \u0441\u043c\u044b\u0441\u043b \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u0434\u0430\u043d\u043d\u044b\u0435 \u0432 \u0446\u0435\u043b\u043e\u0439 \u043a\u044d\u0448 \u043b\u0438\u043d\u0438\u0438. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e \u043b\u0438\u043d\u0435\u0439\u043d\u044bq \u043f\u043e\u0438\u0441\u043a \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448 \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435. \u0414\u043b\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0443\u0442\u044c \u0431\u043e\u043b\u044c\u0448\u0435 \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0439, \u043d\u043e \u043e\u043d \u043f\u043e\u043c\u043e\u0433\u0430\u0435\u0442 \u0443\u043c\u0435\u043d\u044c\u0448\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u044d\u0448 \u043f\u0440\u043e\u043c\u0430\u0445\u043e\u0432.<\/p>\n<h3>\u0427\u0442\u043e \u0432 \u0438\u0442\u043e\u0433\u0435<\/h3>\n<p>\u0414\u0432\u0435 \u0440\u0435\u0444\u0435\u0440\u0435\u043d\u0441\u043d\u044b\u0445 \u0431\u0438\u0431\u043b\u0438\u043e\u0442\u0435\u043a\u0438:<\/p>\n<ul>\n<li>\n<p><a href=\"https:\/\/github.com\/williams-cs\/spider\" rel=\"noopener noreferrer nofollow\">Spider<\/a> &#8212; \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0441\u0432\u0435\u0436\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f, \u043f\u043e \u0437\u0430\u044f\u0432\u043b\u0435\u043d\u0438\u044f\u043c \u0443 \u043d\u0438\u0445 \u043e\u0447\u0435\u043d\u044c \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u044b\u0439 \u0441\u0435\u043b\u0435\u043a\u0442, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043a\u0430\u043a \u0440\u0430\u0437 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0438\u043d\u0442\u0435\u0440\u043f\u043e\u043b\u044f\u0446\u0438\u043e\u043d\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0441 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u0443\u0445\u0438\u0449\u0440\u0435\u043d\u0438\u044f\u043c\u0438. \u0412 \u0446\u0435\u043b\u043e\u043c \u043a \u0441\u043e\u0436\u0430\u043b\u0435\u043d\u0438\u044e \u043d\u0435 \u0440\u0435\u043a\u043e\u043c\u0435\u043d\u0434\u0443\u044e, \u043f\u043e\u0442\u043e\u043c\u0443 \u0447\u0442\u043e \u043a\u043e\u0434 \u043d\u0430\u043f\u0438\u0441\u0430\u043d \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u043a\u0443\u0441\u0442\u0430\u0440\u043d\u043e &#171;\u043f\u043e-\u0430\u043a\u0430\u0434\u0435\u043c\u0438\u0447\u0435\u0441\u043a\u0438&#187;.<\/p>\n<\/li>\n<li>\n<p><a href=\"https:\/\/github.com\/pasta-toolbox\/bit_vector\/tree\/main\" rel=\"noopener noreferrer nofollow\">pasta-toolbox<\/a> &#8212; \u0442\u043e\u0436\u0435 \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0432\u0435\u0436\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f, \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a +SIMD \u0434\u043b\u044f \u0441\u0435\u043b\u0435\u043a\u0442\u0430,  \u044d\u0442\u0430 \u043b\u0438\u0431\u0430 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0430 \u0434\u043e\u0432\u043e\u043b\u044c\u043d\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u0438 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e.<\/p>\n<\/li>\n<\/ul>\n<p>\u0421 \u043d\u0435\u0437\u043d\u0430\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u0442\u043b\u0438\u0447\u0438\u044f\u043c\u0438 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0440\u0430\u043d\u0433-\u0441\u0435\u043b\u0435\u043a\u0442 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u0442\u0430\u043a:<\/p>\n<ul>\n<li>\n<p>\u0411\u0430\u0437\u043e\u0432\u044b\u0439 \u0431\u043b\u043e\u043a 512 \u0431\u0438\u0442<\/p>\n<\/li>\n<li>\n<p>\u0421\u0443\u043f\u0435\u0440 \u0431\u043b\u043e\u043a<img decoding=\"async\" class=\"formula inline\" source=\"2^{16}\" alt=\"2^{16}\" src=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3c\/3ca\/3ca2a55527f9b3df8d7e4b849a6c7b68.svg\" width=\"16\" height=\"16\" sizes=\"auto, (max-width: 780px) 100vw, 50vw\" srcset=\"https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3c\/3ca\/3ca2a55527f9b3df8d7e4b849a6c7b68.svg 780w,&#10;       https:\/\/habrastorage.org\/getpro\/habr\/formulas\/3\/3c\/3ca\/3ca2a55527f9b3df8d7e4b849a6c7b68.svg 781w\" loading=\"lazy\" decode=\"async\"\/> \u0431\u0438\u0442<\/p>\n<\/li>\n<li>\n<p>64-\u0431\u0438\u0442\u043d\u044b\u0435 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u043d\u0433\u0438 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u043e\u0432 0.98% \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430, 16-\u0431\u0438\u0442\u043d\u044b\u0435 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u043d\u0433\u0438 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 3.125% \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e 8192-\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u0430 0.78% \u043e\u0442 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430.<\/p>\n<\/li>\n<\/ul>\n<p>\u0420\u0430\u043d\u0433 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u0438 \u0431\u044b\u043b\u043e \u043e\u043f\u0438\u0441\u0430\u043d\u043e \u0440\u0430\u043d\u044c\u0448\u0435: \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u043d\u0433 + \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u043d\u0433 + popcount \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u043e\u043c \u0431\u043b\u043e\u043a\u0435. \u0421\u0435\u043b\u0435\u043a\u0442: \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u043c \u043f\u043e\u0437\u0438\u0446\u0438\u044e \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0441\u044d\u043c\u043f\u043b\u0430, \u0430 \u0434\u0430\u043b\u044c\u0448\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u0441\u043d\u0430\u0447\u0430\u043b\u0430 \u043f\u043e \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0430\u043c, \u043f\u043e\u0442\u043e\u043c \u043f\u043e \u0431\u0430\u0437\u043e\u0432\u044b\u043c, \u0432 \u043a\u043e\u043d\u0446\u0435 pdep(tzcnt). \u0421 \u043f\u043e\u043c\u043e\u0449\u044c\u044e 512 \u0440\u0435\u0433\u0438\u0441\u0442\u0440\u043e\u0432 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u0442\u044c \u043b\u0438\u0431\u043e 8 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u043d\u0433\u043e\u0432 \u0437\u0430 \u0440\u0430\u0437 \u043b\u0438\u0431\u043e 32 16-\u0431\u0438\u0442\u043d\u044b\u0445 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u043d\u0433\u043e\u0432, \u0434\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u043d\u0433\u0430 \u043a\u043e\u0434 \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043f\u0440\u0438\u043c\u0435\u0440\u043d\u043e \u0442\u0430\u043a<\/p>\n<pre><code class=\"cpp\">for (size_t i = 0; i &lt; 4; ++i) {   auto batch =       _mm512_loadu_epi16(&amp;basic_block_rank[128 * s_block + 32 * i]);   auto cmp = _mm512_cmplt_epu16_mask(batch, rank_32);   auto count = std::popcount(cmp);   if (count &lt; 32) {     return kBlocksPerSuperBlock * s_block + pos + count - 1;   }   pos += 32; }<\/code><\/pre>\n<p>\u0421\u0432\u043e\u044e \u0441\u043e\u0431\u0441\u0442\u0432\u0435\u043d\u043d\u0443\u044e \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044e \u044f <a href=\"https:\/\/github.com\/Malkovsky\/pixie\" rel=\"noopener noreferrer nofollow\">\u0441\u043e\u0431\u0440\u0430\u043b \u0442\u0443\u0442<\/a><\/p>\n<hr\/>\n<p>\u0414\u0440\u0443\u0437\u044c\u044f \u0438 \u043a\u043e\u043b\u043b\u0435\u0433\u0438! \u0421 \u0443\u0434\u043e\u0432\u043e\u043b\u044c\u0441\u0442\u0432\u0438\u0435\u043c \u0445\u043e\u0442\u0435\u043b \u0431\u044b \u043f\u0440\u043e\u0440\u0435\u043a\u043b\u0430\u043c\u0438\u0440\u043e\u0432\u0430\u0442\u044c CS Space \u2014 \u043e\u0442\u043a\u0440\u044b\u0442\u044b\u0439 \u043d\u0430\u0443\u0447\u043d\u044b\u0439 \u043a\u043b\u0443\u0431 \u043f\u043e CS-related \u0442\u0435\u043c\u0430\u043c; \u0438\u0434\u0435\u0439\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u0435\u0439 \u043f\u0438\u0442\u0435\u0440\u0441\u043a\u043e\u0433\u043e\u00a0<a href=\"https:\/\/compsciclub.ru\/\" rel=\"noopener noreferrer nofollow\">Computer Science Club<\/a>\u00a0(\u0438\u00a0<a href=\"https:\/\/compscicenter.ru\/\" rel=\"noopener noreferrer nofollow\">CS Center<\/a>), \u0440\u0430\u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u0432\u0448\u0435\u0433\u043e\u0441\u044f \u043f\u043e\u0441\u043b\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0445 \u0441\u043e\u0431\u044b\u0442\u0438\u0439. \u0420\u0435\u0431\u044f\u0442\u0430 \u043e\u0440\u0433\u0430\u043d\u0438\u0437\u0443\u044e\u0442 \u043a\u0440\u0443\u0442\u044b\u0435 \u043b\u0435\u043a\u0446\u0438\u0438 \u0438 \u043a\u0443\u0440\u0441\u044b \u043f\u043e CS \u043e\u0442 \u043f\u0440\u043e\u0444\u0435\u0441\u0441\u0438\u043e\u043d\u0430\u043b\u043e\u0432 \u0441\u0432\u043e\u0435\u0433\u043e \u0434\u0435\u043b\u0430, \u0434\u0430 \u0435\u0449\u0435 \u0438 \u043f\u043e\u043c\u043e\u0433\u0430\u044e\u0442 \u043c\u043d\u0435 \u0441 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c \u043d\u0430\u0443\u0447\u043d\u043e-\u043f\u043e\u043f\u0443\u043b\u044f\u0440\u043d\u044b\u0445 \u0441\u0442\u0430\u0442\u0435\u0439!<\/p>\n<p>\u0421\u0430\u0439\u0442 \u0441\u043e\u043e\u0431\u0449\u0435\u0441\u0442\u0432\u0430:\u00a0<a href=\"http:\/\/csspace.io\" rel=\"noopener noreferrer nofollow\">csspace.io<\/a><br \/>Telegram-\u043a\u0430\u043d\u0430\u043b:\u00a0<a href=\"https:\/\/t.me\/csspace\" rel=\"noopener noreferrer nofollow\">t.me\/csspace<\/a><\/p>\n<p>\u0415\u0441\u043b\u0438 \u0432\u0430\u043c \u043f\u043e\u043d\u0440\u0430\u0432\u0438\u043b\u0430\u0441\u044c \u0441\u0442\u0430\u0442\u044c\u044f \u2014 \u043f\u043e\u0441\u0442\u0430\u0432\u044c\u0442\u0435 \u043f\u043b\u044e\u0441, \u0430\u0432\u0442\u043e\u0440\u0443 \u0432\u0441\u0435\u0433\u0434\u0430 \u043f\u0440\u0438\u044f\u0442\u043d\u043e \u043a\u043e\u0433\u0434\u0430 \u0435\u0433\u043e \u0440\u0430\u0431\u043e\u0442\u0443 \u0446\u0435\u043d\u044f\u0442. \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u043e \u0432\u0430\u0441 \u0442\u0430\u043a\u0436\u0435 \u0437\u0430\u0438\u043d\u0442\u0435\u0440\u0435\u0441\u0443\u0435\u0442 \u043c\u043e\u0439 \u043a\u0430\u043d\u0430\u043b\u00a0<a href=\"https:\/\/t.me\/a%5C_nahui%5C_eto%5C_nuzhno\" rel=\"noopener noreferrer nofollow\">\u0410 \u0437\u0430\u0447\u0435\u043c \u044d\u0442\u043e \u043d\u0443\u0436\u043d\u043e?<\/a>\u00a0\u0433\u0434\u0435 \u044f \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u044e \u043e \u0442\u043e\u043c, \u0447\u0442\u043e \u043c\u0430\u0442\u0435\u043c\u0430\u0442\u0438\u043a\u0443 \u0438 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u043f\u0440\u0438\u0434\u0443\u043c\u0430\u043b\u0438 \u043d\u0435 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u0441\u043e\u0431\u0435\u0441\u0435\u0434\u043e\u0432\u0430\u043d\u0438\u0439 \u0432 \u0431\u0438\u0433\u0442\u0435\u0445\u0438.<\/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\/939614\/\"> https:\/\/habr.com\/ru\/articles\/939614\/<\/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<figure class=\"full-width\">\n<div><figcaption>\u041f\u0440\u0438\u043c\u0435\u0440 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0438 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u043d\u0433\/\u0441\u0435\u043b\u0435\u043a\u0442 \u043d\u0430\u0434 \u043d\u0438\u043c, \u0441\u043f\u0440\u0430\u0432\u0430 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u043f\u0435\u0446\u0438\u0430\u043b\u044c\u043d\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043d\u044b\u0445 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0439.<\/figcaption><\/div>\n<\/figure>\n<p>\u042d\u0442\u043e \u043f\u0435\u0440\u0432\u0430\u044f \u0441\u0442\u0430\u0442\u044c\u044f \u0438\u0437 \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u0435\u043c\u043e\u0439 \u0441\u0435\u0440\u0438\u0438 \u043f\u0440\u043e <strong>succinct data structures <\/strong>&#8212; \u044d\u0442\u043e \u043a\u043b\u0430\u0441\u0441 \u043e\u0447\u0435\u043d\u044c \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 \u0434\u0430\u043d\u043d\u044b\u0445. \u041a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b &#8212; \u044d\u0442\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430 \u0432 \u0432\u0438\u0434\u0435 \u043f\u0440\u0430\u0432\u0438\u043b\u044c\u043d\u043e\u0439 \u0441\u043a\u043e\u0431\u043e\u0447\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438, \u0434\u0435\u0440\u0435\u0432\u043e \u0438\u0437\u0432\u0435\u0440\u0448\u0438\u043d \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e\u0431\u0438\u0442 \u0432 \u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043a\u0430\u043a \u0442\u0438\u043f\u0438\u0447\u043d\u0430\u044f \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0442\u0440\u0435\u0431\u043e\u0432\u0430\u043b\u0430 \u0431\u044b \u043a\u0430\u043a \u0434\u0432\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044f \u043f\u043e 64-\u0431\u0438\u0442 \u043d\u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u0443\u0437\u0435\u043b (\u0440\u0430\u0437\u0443\u043c\u0435\u0435\u0442\u0441\u044f \u043c\u043e\u0436\u043d\u043e \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043e\u043a\u0440\u0430\u0442\u0438\u0442\u044c \u043f\u0440\u043e\u0441\u0442\u044b\u043c\u0438 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f\u043c\u0438, \u043d\u043e \u0434\u0430\u0436\u0435 \u0431\u043b\u0438\u0437\u043a\u043e 2 \u0431\u0438\u0442\u0430 \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c). \u0424\u0443\u043d\u0434\u0430\u043c\u0435\u043d\u0442 \u043f\u043e\u0434\u043e\u0431\u043d\u044b\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 &#8212; \u044d\u0442\u043e <strong>rank-select \u0441\u043b\u043e\u0432\u0430\u0440\u044c<\/strong>, \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0449\u0438\u0439 \u0441\u043e\u0431\u043e\u0439 \u0431\u0438\u0442\u043e\u0432\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0438 \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443 \u0434\u043b\u044f \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044e \u0434\u0432\u0443\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 <em>\u0440\u0430\u043d\u0433<\/em> \u0438 <em>\u0441\u0435\u043b\u0435\u043a\u0442<\/em>. \u0412 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u0435 \u0441 \u0434\u0435\u0440\u0435\u0432\u043e\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0440\u0430\u043d\u0433\u0430 \u0438 \u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0430\u0437\u043e\u0432\u0443\u044e \u043d\u0430\u0432\u0438\u0433\u0430\u0446\u0438\u044e: \u043d\u0430\u0439\u0442\u0438 \u043d\u043e\u043c\u0435\u0440\u0430 \u043f\u043e\u0442\u043e\u043c\u043a\u043e\u0432\/\u0440\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u0439, \u0443\u0437\u043d\u0430\u0442\u044c \u0440\u0430\u0437\u043c\u0435\u0440 \u043f\u043e\u0434\u0434\u0435\u0440\u0435\u0432\u0430. \u0412 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0441\u0441\u043a\u0430\u0436\u0443 \u043a\u0430\u043a \u0434\u0435\u043b\u0430\u0442\u044c \u044d\u0442\u0438 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u0431\u044b\u0441\u0442\u0440\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u0432\u0441\u0435\u0433\u043e 3,6% \u0434\u043e\u043f\u043e\u043b\u043d\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438. <strong> <em> <\/em><\/strong><\/p>\n<h3>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h3>\n<p><strong><em>Rank-select dictionary<\/em><\/strong> <strong>(RSD)<\/strong> &#8212; \u044d\u0442\u043e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0430\u044f \u043f\u043e\u0432\u0435\u0440\u0445 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0438\u0442\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438, \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0449\u0430\u044f \u044d\u0444\u0444\u0435\u043a\u0442\u0438\u0432\u043d\u043e \u043e\u0442\u0432\u0435\u0447\u0430\u0442\u044c \u043d\u0430 \u0434\u0432\u0430 \u0437\u0430\u043f\u0440\u043e\u0441\u0430:<\/p>\n<ul>\n<li>\n<p> &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0431\u0438\u0442 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445, \u0442.\u0435.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p> &#8212; \u043f\u043e\u0437\u0438\u0446\u0438\u044f-\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u0430, \u0442.\u0435. <\/p>\n<\/li>\n<\/ul>\n<p>\u041d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u043a\u0438 (\u0434\u043e\u0433\u043e\u0432\u043e\u0440\u0438\u043c\u0441\u044f, \u0447\u0442\u043e \u0432 \u0441\u0442\u0430\u0442\u044c\u0435 \u0440\u0430\u0431\u043e\u0442\u0430\u0435\u043c \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0447\u0438\u0442\u0430\u0442\u044c \u0441\u043b\u0435\u0432\u0430-\u043d\u0430\u043f\u0440\u0430\u0432\u043e)<\/p>\n<ul>\n<li>\n<\/li>\n<li>\n<\/li>\n<\/ul>\n<p>\u0410\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u044b\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u044e\u0442\u0441\u044f<\/p>\n<ul>\n<li>\n<p> &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0438\u0442 \u043d\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u044f\u0445<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p> &#8212; \u043f\u043e\u0437\u0438\u0446\u0438\u044f-\u043e\u0433\u043e \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e \u0431\u0438\u0442\u0430<\/p>\n<\/li>\n<\/ul>\n<figure class=\"full-width\">\n<div><figcaption>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u043d\u0430 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0435<\/figcaption><\/div>\n<\/figure>\n<p><strong>UPD. <\/strong>\u041d\u0430 \u043a\u0430\u0440\u0442\u0438\u043d\u043a\u0435 \u043e\u0448\u0438\u0431\u043a\u0430 \u0432 rank1, \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0434\u043e\u043b\u0436\u043d\u0430 \u0431\u044b\u0442\u044c<strong> <\/strong>0,1,2,2,3,4,4,5,6,7,7,8,8,8,8,9,10<\/p>\n<h3>LOUDS \u041f\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430<\/h3>\n<p>RSD \u043d\u0435 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0441\u0430\u043c\u043e\u0441\u0442\u043e\u044f\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043e\u0439 \u043f\u043e\u043b\u0435\u0437\u043d\u043e\u0439 \u0434\u043b\u044f \u0448\u0438\u0440\u043e\u043a\u043e\u0433\u043e \u043a\u043b\u0430\u0441\u0441\u0430 \u0437\u0430\u0434\u0430\u0447 \u043a\u0430\u043a \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0445\u044d\u0448-\u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0438\u043b\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0435 \u0434\u0435\u0440\u0435\u0432\u044c\u044f \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u043e \u043d\u0430 \u043d\u0435\u0439 \u0441\u0442\u0440\u043e\u044f\u0442\u0441\u044f \u0432\u0441\u0435 \u0438\u0437\u0432\u0435\u0441\u0442\u043d\u044b\u0435 succinct \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b. \u041f\u043e\u0434\u0440\u043e\u0431\u043d\u043e \u043f\u0440\u043e \u043d\u0438\u0445 \u0440\u0430\u0441\u0441\u043a\u0430\u0437\u044b\u0432\u0430\u0442\u044c \u044f \u043f\u043b\u0430\u043d\u0438\u0440\u0443\u044e \u0432 \u0434\u0440\u0443\u0433\u0438\u0445 \u0441\u0442\u0430\u0442\u044c\u044f\u0445, \u0430 \u043f\u043e\u043a\u0430 \u043d\u0435\u0431\u043e\u043b\u044c\u0448\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0442\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440 &#8212; <strong>Level-Ordered Unary Degree Sequence (LOUDS)<\/strong> \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u0435 \u0434\u0435\u0440\u0435\u0432\u0430<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u043a\u043e\u043c\u043f\u0430\u043a\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0438\u044f \u0434\u0435\u0440\u0435\u0432\u0430<\/figcaption><\/div>\n<\/figure>\n<p>LOUDS \u0441\u0442\u0440\u043e\u0438\u0442\u0441\u044f \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0438, \u0434\u0435\u043b\u0430\u0435\u043c \u043e\u0431\u0445\u043e\u0434 \u0432 \u0448\u0438\u0440\u0438\u043d\u0443 \u0434\u0435\u0440\u0435\u0432\u0430,  \u043f\u0440\u0438 \u043f\u043e\u0441\u0435\u0449\u0435\u043d\u0438\u0438 \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u0441 \u0434\u0435\u0442\u044c\u043c\u0438 \u0434\u043e\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0432 \u043a\u043e\u043d\u0435\u0446 \u0441\u0442\u0440\u043e\u043a\u0438 \u0435\u0434\u0438\u043d\u0438\u0446 \u0438 \u043e\u0434\u0438\u043d \u043d\u043e\u043b\u044c. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u043d\u0430 \u0434\u0435\u0440\u0435\u0432\u043e \u0438\u0437 \u0432\u0435\u0440\u0448\u0438\u043d \u0431\u0443\u0434\u0435\u0442 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043d\u0443\u043b\u0435\u0439 \u0438 \u0435\u0434\u0438\u043d\u0438\u0446. \u0415\u0441\u043b\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u043b\u043e\u0436\u0438\u0442\u044c, \u0447\u0442\u043e \u0432\u0435\u0440\u0448\u0438\u043d\u044b \u043f\u0440\u043e\u043d\u0443\u043c\u0435\u0440\u043e\u0432\u0430\u043d\u044b \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u043e\u0431\u0445\u043e\u0434\u043e\u043c \u0432 \u0448\u0438\u0440\u0438\u043d\u0443, \u0442\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0438 \u043f\u043e \u0434\u0435\u0440\u0435\u0432\u0443 \u0432\u044b\u0440\u0430\u0436\u0430\u044e\u0442\u0441\u044f \u0447\u0435\u0440\u0435\u0437 Rank\/Select<\/p>\n<ul>\n<li>\n<p>\u0421\u0442\u0435\u043f\u0435\u043d\u044c \u0432\u0435\u0440\u0448\u0438\u043d\u044b<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041d\u043e\u043c\u0435\u0440-\u043e\u0433\u043e \u0440\u0435\u0431\u0451\u043d\u043a\u0430-\u043e\u0433\u043e \u0443\u0437\u043b\u0430.<\/p>\n<\/li>\n<\/ul>\n<ul>\n<li>\n<p>\u041d\u043e\u043c\u0435\u0440 \u0440\u043e\u0434\u0438\u0442\u0435\u043b\u044f-\u043e\u0433\u043e \u0443\u0437\u043b\u0430<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u0431\u044b\u0447\u043d\u043e \u044d\u0442\u043e\u0433\u043e \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0434\u043b\u044f \u0442\u043e\u0433\u043e, \u0447\u0442\u043e\u0431\u044b \u0434\u0435\u043b\u0430\u0442\u044c \u043e\u0431\u0445\u043e\u0434\u044b \u0432 \u0433\u043b\u0443\u0431\u0438\u043d\u0443\/\u0448\u0438\u0440\u0438\u043d\u0443 \u0438\u043b\u0438 \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043f\u043e\u0438\u0441\u043a \u0432 \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u043c \u0434\u0435\u0440\u0435\u0432\u0435 \u043f\u043e\u0438\u0441\u043a\u0430, \u043d\u043e \u043f\u0440\u0438 \u044d\u0442\u043e\u043c \u043e\u0431\u044a\u0435\u043c \u0434\u0430\u043d\u043d\u044b\u0445, \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u044b\u0439 \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u043d\u043e\u0439 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0438 \u2014 2 \u0431\u0438\u0442\u0430 \u043d\u0430 \u0443\u0437\u0435\u043b \u043f\u0440\u043e\u0442\u0438\u0432 2-\u0445 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u0435\u0439 \u0432 \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438. \u041d\u0435 \u043e\u0447\u0435\u043d\u044c \u0441\u043b\u043e\u0436\u043d\u044b\u043c\u0438 \u043c\u0430\u0445\u0438\u043d\u0430\u0446\u0438\u044f\u043c\u0438 \u043c\u043e\u0436\u043d\u043e \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u0431\u0438\u0442 \u043d\u0430 \u0443\u043a\u0430\u0437\u0430\u0442\u0435\u043b\u044c, \u043d\u043e \u043d\u0435 \u0431\u043e\u043b\u0435\u0435 \u0442\u043e\u0433\u043e.<\/p>\n<h3>\u041d\u0430\u0438\u0432\u043d\u0430\u044f \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f RSD<\/h3>\n<p>\u0421\u0430\u043c\u044b\u0439 \u043f\u0440\u043e\u0441\u0442\u043e \u0441\u043f\u043e\u0441\u043e\u0431 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0438 Rank\/Select \u043f\u043e\u0432\u0435\u0440\u0445 \u0431\u0438\u0442\u0432\u0435\u043a\u0442\u043e\u0440\u0430 \u0434\u043b\u0438\u043d\u044b \u0432\u044b\u0433\u043b\u044f\u0434\u0438\u0442 \u043a\u0430\u043a-\u0442\u043e \u0442\u0430\u043a: \u0437\u0430\u0432\u043e\u0434\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0434\u043b\u0438\u043d\u044b \u0438 \u0445\u0440\u0430\u043d\u0438\u043c \u0432 \u0447\u0430\u0441\u0442\u0438\u0447\u043d\u044b\u0435 \u0441\u0443\u043c\u043c\u044b<\/p>\n<p>\u0422\u043e\u0433\u0434\u0430, \u0430 \u0434\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043d\u0443\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043f\u043e. \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c \u0440\u0430\u043d\u0433 \u0432\u044b \u0443\u043c\u0435\u0435\u043c \u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0437\u0430, \u0441\u0435\u043b\u0435\u043a\u0442 \u0437\u0430. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0432 \u043f\u0440\u043e\u0431\u0435\u0433\u0430\u044e\u0442 \u0432 \u0445\u0443\u0434\u0448\u0435\u043c \u0441\u043b\u0443\u0447\u0430\u0435 \u043e\u0442 \u0434\u043e, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043d\u0443\u0436\u043d\u043e \u0431\u0438\u0442.<\/p>\n<h3>Succinct rank<\/h3>\n<p>\u0412 1998 \u042f\u043a\u043e\u0431\u0441\u043e\u043d <a href=\"https:\/\/www.proquest.com\/openview\/1f1b9d0e30bf4a45896aca5e3b164dbb\/1?pq-origsite=gscholar&amp;cbl=18750&amp;diss=y\" rel=\"noopener noreferrer nofollow\">\u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u0438\u043b \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443<\/a>, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 Rank\/Select \u043c\u043e\u0436\u043d\u043e \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0437\u0430 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f \u043f\u0430\u043c\u044f\u0442\u0438. \u041f\u0435\u0440\u0432\u0438\u0447\u043d\u0430\u044f \u0438\u0434\u0435\u044f \u0441\u0445\u043e\u0436\u0430 \u0441 \u043c\u0435\u0442\u043e\u0434\u043e\u043c \u0447\u0435\u0442\u044b\u0440\u0451\u0445 \u0440\u0443\u0441\u0441\u043a\u0438\u0445: \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0435\u0439 \u0431\u0438\u0442\u043e\u0432\u044b\u0445 \u0441\u0442\u0440\u043e\u043a \u0434\u043b\u0438\u043d\u044b \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435<em> <\/em>\u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0431\u0438\u0442 \u0432 \u044d\u0442\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c. \u0422\u0430\u043a\u0438\u0445 \u0441\u0442\u0440\u043e\u043a \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435. \u041f\u0443\u0441\u0442\u044c- \u0440\u0430\u043d\u0433 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430-\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0434\u043b\u0438\u043d\u044b, \u0442.\u0435.<\/p>\n<p>\u0442\u043e\u0433\u0434\u0430 \u0440\u0430\u043d\u0433 \u043c\u043e\u0436\u043d\u043e \u0440\u0430\u0437\u0431\u0438\u0442\u044c \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438 \u2014 \u0440\u0430\u043d\u0433 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0438 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u0434\u043b\u0438\u043d\u044b \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435.<\/p>\n<p>\u0422\u0435\u043f\u0435\u0440\u044c \u0436\u0435 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u043d\u0433\u0430 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0435\u0442\u043e\u043c \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u0434\u043b\u0438\u043d\u044b, \u043c\u0430\u0441\u0441\u0438\u0432<em> <\/em>\u0438\u043c\u0435\u0435\u0442 \u0434\u043b\u0438\u043d\u0443, \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u0437\u0430\u043d\u0438\u043c\u0430\u0435\u0442<em> <\/em>\u0431\u0438\u0442 \u2014 \u0432 \u0438\u0442\u043e\u0433\u0435 \u043c\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c \u043f\u0430\u043c\u044f\u0442\u0438, \u0442\u043e \u0435\u0441\u0442\u044c \u043f\u043e\u043a\u0430 \u0435\u0449\u0435 \u043d\u0435 succinct. \u0427\u0442\u043e\u0431\u044b \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f succinct \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c <a href=\"https:\/\/ru.wikipedia.org\/wiki\/%D0%94%D0%B5%D0%BB%D1%8C%D1%82%D0%B0-%D0%BA%D0%BE%D0%B4%D0%B8%D1%80%D0%BE%D0%B2%D0%B0%D0%BD%D0%B8%D0%B5\" rel=\"noopener noreferrer nofollow\">\u0434\u0435\u043b\u044c\u0442\u0430 \u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435<\/a> \u0438\u043b\u0438 <a href=\"https:\/\/www.antoniomallia.it\/sorted-integers-compression-with-elias-fano-encoding.html\" rel=\"noopener noreferrer nofollow\">\u043a\u043e\u0434\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 \u042d\u043b\u0438\u0430\u0441\u0430-\u0424\u0430\u043d\u043e<\/a> \u0434\u043b\u044f \u0441\u0436\u0430\u0442\u0438\u044f \u043c\u043e\u043d\u043e\u0442\u043e\u043d\u043d\u043e\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438. \u042f\u043a\u043e\u0431\u0441\u043e\u043d \u043f\u0440\u0435\u0434\u043b\u043e\u0436\u0438\u043b \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0443\u044e \u044f\u0432\u043d\u0443\u044e \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u0443. \u041a \u0431\u043b\u043e\u043a\u0430\u043c \u0434\u043b\u0438\u043d\u044b \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0438 \u0434\u043b\u0438\u043d\u044b. \u0422\u0435\u043f\u0435\u0440\u044c, \u0440\u0430\u043d\u0433 \u043c\u044b \u0445\u0440\u0430\u043d\u0438\u043c \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0430, \u0430 \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0445\u0440\u0430\u043d\u0438\u043c \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0439 \u0440\u0430\u043d\u0433, \u0442.\u0435. \u0440\u0430\u043d\u0433 \u043f\u043e \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u044e \u043a \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0435\u043c\u0443 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0443. \u0414\u043b\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u043d\u0433\u0430 \u043d\u0443\u0436\u043d\u043e \u0443\u043c\u0435\u0442\u044c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0440\u0430\u0437\u043b\u0438\u0447\u043d\u044b\u0445 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0439, \u0434\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u043d\u0443\u0436\u043d\u043e\u0431\u0438\u0442. \u0412 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c<\/p>\n<ul>\n<li>\n<p> \u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0440\u0430\u043d\u0433\u043e\u0432 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0442\u0430\u0431\u043b\u0438\u0446 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432<\/p>\n<\/li>\n<li>\n<p>\u0434\u043b\u044f \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0445 \u0440\u0430\u043d\u0433\u043e\u0432<\/p>\n<\/li>\n<\/ul>\n<p>\u0441 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0438\u0440\u0443\u044e\u0449\u0435\u0439 \u0444\u043e\u0440\u043c\u0443\u043b\u043e\u0439<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0440\u0430\u043d\u0433\u0430: \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u044b\u0435 \u0438 \u043b\u043e\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0440\u0430\u043d\u0433\u0438 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u044b, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0442\u043e\u0436\u0435, \u043d\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u0432\u043d\u0443\u0442\u0440\u0438 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u043f\u0440\u043e\u0449\u0435 \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0430\u0440\u0438\u0444\u043c\u0435\u0442\u0438\u0447\u0435\u0441\u043a\u0438<\/figcaption><\/div>\n<\/figure>\n<h3>Succinct select<\/h3>\n<p>\u041e\u043f\u0438\u0448\u0443 \u0443\u043f\u0440\u043e\u0449\u0451\u043d\u043d\u0443\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0432\u0435\u0440\u0441\u0438\u044e \u0441\u0435\u043b\u0435\u043a\u0442\u0430, \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u043c\u043e\u0436\u043d\u043e \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0430\u0441\u0438\u043c\u043f\u0442\u043e\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0435 \u0432\u0440\u0435\u043c\u044f \u0437\u0430\u043f\u0440\u043e\u0441\u0430, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u043e\u043f\u044b\u0442\u043a\u0430 \u0434\u043e\u0431\u0438\u0442\u044c\u0441\u044f \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043d\u0442\u0440\u043f\u0440\u043e\u0434\u0443\u043a\u0442\u0438\u0432\u043d\u043e\u0439. \u0418\u0442\u0430\u043a, 3 \u043e\u0441\u043d\u043e\u0432\u043d\u044b\u0435 \u0438\u0434\u0435\u0438 \u0434\u043b\u044f \u0441\u0435\u043b\u0435\u043a\u0442<\/p>\n<ul>\n<li>\n<p>\u041a\u0430\u043a \u0438 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435 \u0441 \u0440\u0430\u043d\u0433\u043e\u043c \u0434\u043b\u044f \u0431\u043b\u043e\u043a\u043e\u0432 \u0434\u043b\u0438\u043d\u044b \u043d\u0435 \u0431\u043e\u043b\u044c\u0448\u0435<em> \u043c\u043e\u0436\u043d\u043e <\/em>\u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u0442\u044c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u0434\u043b\u044f \u0432\u0441\u0435\u0445 \u0432\u043e\u0437\u043c\u043e\u0436\u043d\u044b\u0445 \u0431\u043b\u043e\u043a\u043e\u0432 \u0442\u0430\u043a\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0437\u0430\u043f\u0440\u043e\u0441\u043e\u043c \u0440\u0430\u043d\u0433\u0430 \u0432 \u0434\u0438\u0430\u043f\u0430\u0437\u043e\u043d\u0435, \u0438\u0437 \u0447\u0435\u0433\u043e \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/p>\n<\/li>\n<li>\n<p>\u041a\u0430\u043a \u0443\u0436\u0435 \u043e\u0442\u043c\u0435\u0447\u0430\u043b\u043e\u0441\u044c, \u043c\u043e\u0436\u043d\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u043f\u043e\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0435 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u043d\u0433\u0430 \u0434\u043b\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0434\u043b\u044f \u043d\u0430\u0445\u043e\u0436\u0434\u0435\u043d\u0438\u044f \u0441\u0435\u043b\u0435\u043a\u0442\u0430. \u0422\u0443\u0442 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u0430\u043a\u043a\u0443\u0440\u0430\u0442\u043d\u043e \u043e\u0446\u0435\u043d\u0438\u0432\u0430\u0442\u044c \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u044c \u0431\u0438\u043d\u0430\u0440\u043d\u043e\u0433\u043e \u043f\u043e\u0438\u0441\u043a\u0430 \u0442\u0430\u043a \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f  \u0441\u0442\u043e\u0438\u0442 \u0434\u043b\u044f \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u044b. \u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0440\u0430\u043d\u0433\u0430\u0445 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u043e\u0432 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442\u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439. \u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u0445 \u0441\u0442\u043e\u0438\u0442 \u043d\u0430 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u044e \u0438 \u0434\u0435\u043b\u0430\u0435\u0442 \u0438\u0442\u0435\u0440\u0430\u0446\u0438\u0439.<\/p>\n<\/li>\n<li>\n<p>\u0411\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0430 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0430\u0445 \u0434\u043e\u0440\u043e\u0433\u043e\u0439, \u043d\u043e \u043e\u0442 \u043d\u0435\u0433\u043e \u043c\u043e\u0436\u043d\u043e \u0438\u0437\u0431\u0430\u0432\u0438\u0442\u044c\u0441\u044f \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u043f\u043e\u0437\u0438\u0446\u0438\u0438 \u043a\u0430\u0436\u0434\u043e\u0433\u043e-\u043e\u0433\u043e \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u043e\u0433\u043e \u0431\u0438\u0442\u0430. \u0415\u0441\u043b\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0438\u0442\u044c, \u0442\u043e<\/p>\n<\/li>\n<\/ul>\n<p>\u041e\u043f\u0443\u0441\u043a\u0430\u044e \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u0434\u0435\u0442\u0430\u043b\u0435\u0439 \u043a\u0430\u0441\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0440\u0430\u0437\u0440\u0435\u0436\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0434\u043b\u044f \u0441\u0442\u0440\u043e\u0433\u043e\u0439 \u043e\u0446\u0435\u043d\u043a\u0438 \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0447\u0430\u0441\u0442\u0438 \u0442\u0430\u043a \u043a\u0430\u043a \u044d\u0442\u043e \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043f\u043e\u0447\u0442\u0438 \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f, \u0437\u0430\u0447\u0430\u0441\u0442\u0443\u044e \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043d\u0435 \u0441\u0438\u043b\u044c\u043d\u043e \u0432\u044b\u0438\u0433\u0440\u044b\u0432\u0430\u0435\u0442 \u0443 \u043b\u0438\u043d\u0435\u0439\u043d\u043e\u0433\u043e \u0432 \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u0441\u0435\u043b\u0435\u043a\u0442\u0430.<\/p>\n<figure class=\"full-width\">\n<div><figcaption>\u041f\u043e\u0434\u0441\u0447\u0435\u0442 \u0441\u0435\u043b\u0435\u043a\u0442\u0430: \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u043c \u0441 \u0437\u0430\u0440\u0430\u043d\u0435\u0435 \u043f\u0440\u0435\u0434\u043f\u043e\u0434\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u043f\u043e\u0437\u0438\u0446\u0438\u0439. \u0412 \u0442\u0435\u043e\u0440\u0438\u0438 \u0431\u0438\u043d\u0430\u0440\u043d\u044b\u0439 \u043f\u043e\u0438\u0441\u043a \u043b\u0443\u0447\u0448\u0435, \u043d\u0430 \u043f\u0440\u0430\u043a\u0442\u0438\u043a\u0435 \u043b\u0438\u043d\u0435\u0439\u043d\u044b\u0439 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0439<\/figcaption><\/div>\n<\/figure>\n<h3>\u041f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438\u0435 \u0430\u0441\u043f\u0435\u043a\u0442\u044b \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430<\/h3>\n<p>\u0414\u043b\u044f \u043d\u0430\u0447\u0430\u043b\u0430 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c \u043e\u0431\u0449\u0438\u0435 \u043c\u043e\u043c\u0435\u043d\u0442\u044b \u043f\u043e \u0436\u0435\u043b\u0435\u0437\u0443, \u043e\u0440\u0438\u0435\u043d\u0442\u0438\u0440\u0443\u0435\u043c\u0441\u044f \u043d\u0430 CPU<\/p>\n<ul>\n<li>\n<p>\u0414\u043b\u044f \u0432\u0441\u0435\u0445 \u0440\u0430\u0437\u0443\u043c\u043d\u044b\u0445 \u043f\u0440\u0438\u043c\u0435\u043d\u0435\u043d\u0438\u0439 \u0438, \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e,. \u041e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0434 \u0431\u0438\u0442\u0430\u043c\u0438 \u0442\u0430\u043a\u0430\u044f \u0436\u0435 \u043f\u043e \u0441\u043b\u043e\u0436\u043d\u043e\u0441\u0442\u0438 \u043a\u0430\u043a \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u044f \u043d\u0430\u0434 1 \u0431\u0438\u0442\u043e\u043c.<\/p>\n<\/li>\n<li>\n<p>\u0422\u0430\u0431\u043b\u0438\u0446\u044b \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e \u0431\u043e\u043b\u044c\u0448\u0438\u0435 \u0447\u0442\u043e\u0431\u044b \u0442\u043e\u0447\u043d\u043e \u043d\u0435 \u0432\u043c\u0435\u0449\u0430\u0442\u044c\u0441\u044f \u0432 L1 \u043a\u044d\u0448, \u0430 \u043c\u043e\u0436\u0435\u0442 \u0434\u0430\u0436\u0435 \u0438 \u0432 L2\/L3. \u0418\u0437-\u0437\u0430 \u044d\u0442\u043e\u0433\u043e Broadword programming\/SWAR (\u0441\u043c. \u043d\u0430\u043f\u0440\u0438\u043c\u0435\u0440 <a href=\"https:\/\/habr.com\/ru\/articles\/886182\/\" rel=\"noopener noreferrer nofollow\">\u0441\u0442\u0430\u0442\u044c\u044e<\/a>) \u043f\u043e\u0434\u0445\u043e\u0434\u044b \u043f\u0440\u0435\u0434\u043f\u043e\u0447\u0442\u0438\u0442\u0435\u043b\u044c\u043d\u0435\u0439 \u0442\u0430\u0431\u043b\u0438\u0447\u043d\u044b\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0415\u0449\u0435 \u043f\u0440\u043e \u043a\u044d\u0448\u0438: \u043c\u044b \u0445\u043e\u0442\u0438\u043c \u0434\u0435\u043b\u0430\u0442\u044c \u0431\u044b\u0441\u0442\u0440\u044b\u0435 \u0437\u0430\u043f\u0440\u043e\u0441\u044b \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044f 2-3 \u0442\u0430\u0431\u043b\u0438\u0446\u044b \u043f\u043e\u0432\u0435\u0440\u0445 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043a\u044d\u0448 \u043f\u0440\u043e\u043c\u0430\u0445\u043e\u0432 \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0432 \u044d\u0442\u043e\u0439 \u0441\u0438\u0442\u0443\u0430\u0446\u0438\u0438 \u0431\u043e\u0442\u0442\u043b\u043d\u0435\u043a\u043e\u043c \u0438 \u044d\u0442\u043e \u043f\u0435\u0440\u0432\u043e\u0435, \u0447\u0442\u043e \u0441\u0442\u043e\u0438\u0442 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043f\u0440\u0438 \u0432\u044b\u0431\u043e\u0440\u0435 \u043f\u0430\u0440\u0430\u043c\u0435\u0442\u0440\u043e\u0432 \u0430\u0440\u0445\u0438\u0442\u0435\u043a\u0442\u0443\u0440\u044b. \u0412 \u0447\u0430\u0441\u0442\u043d\u043e\u0441\u0442\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u0431\u0430\u0437\u043e\u0432\u043e\u0433\u043e \u0431\u043b\u043e\u043a\u0430 \u0441\u0442\u043e\u0438\u0442 \u0432\u044b\u0431\u0438\u0440\u0430\u0442\u044c \u043f\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0443 \u043a\u044d\u0448 \u043b\u0438\u043d\u0438\u0438, \u0442.\u0435. 64 \u0431\u0430\u0439\u0442\/512 \u0431\u0438\u0442 \u0434\u043b\u044f \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0430 CPU. \u0415\u0441\u0442\u044c \u043e\u0434\u043d\u0430 \u043e\u043f\u0442\u0438\u043c\u0438\u0437\u0430\u0446\u0438\u044f, \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u044e\u0449\u0430\u044f \u0432 \u0431\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u0435 \u0440\u0435\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u0439 &#8212; interleaving, \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431\u044b \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u0438\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440 \u0432\u043f\u0435\u0440\u0435\u043c\u0435\u0448\u043a\u0443 \u0441 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u0435\u0439 \u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0431\u043b\u043e\u043a\u0430\u0445 \u0438\u043b\u0438 \u0436\u0435 \u0438\u043d\u0444\u043e\u0440\u043c\u0430\u0446\u0438\u044e \u043e \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u0438 \u0441\u0443\u043f\u0435\u0440\u0431\u043b\u043e\u043a\u0430\u0445.<\/p>\n<\/li>\n<li>\n<p>\u0411\u043e\u043b\u044c\u0448\u0438\u043d\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 POPCNT, TZCNT \u0438 PDEP \u0438 \u0438\u0445 SIMD \u0432\u0435\u0440\u0441\u0438\u0438. \u041f\u0435\u0440\u0432\u0430\u044f \u2014 \u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432 \u0432 \u0447\u0438\u0441\u043b\u0435, \u0432\u0442\u043e\u0440\u0430\u044f &#8212; \u043f\u043e\u0434\u0441\u0447\u0451\u0442 \u043f\u0435\u0440\u0432\u044b\u0445 \u043d\u0443\u043b\u0435\u0432\u044b\u0445 \u0431\u0438\u0442, \u0442\u0440\u0435\u0442\u044c\u044f \u043d\u0435\u043c\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0436\u043d\u0435\u0435, \u043e\u043f\u0438\u0448\u0443 \u043f\u043e\u0437\u0436\u0435. \u0420\u0430\u043d\u0433 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e 512 \u0431\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e POPCNT, \u0441\u0435\u043b\u0435\u043a\u0442 \u0442\u0430\u043a\u0436\u0435 \u0432\u043f\u043b\u043e\u0442\u044c \u0434\u043e 512 \u0431\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u043f\u0440\u043e\u0434\u0435\u043b\u0430\u0442\u044c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e PDEP+TZCNT. POPCNT \u0438 TZCNT \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u0447\u0430\u0441\u0442\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u0430 <a href=\"https:\/\/en.cppreference.com\/w\/cpp\/utility\/bit.html\" rel=\"noopener noreferrer nofollow\">\u0421++20<\/a>, \u0430 \u0432\u043e\u0442 c PDEP \u043f\u0440\u0438\u0434\u0451\u0442\u0441\u044f \u0432\u043e\u0437\u0438\u0442\u044c\u0441\u044f \u0432\u0440\u0443\u0447\u043d\u0443\u044e. \u0422\u0430\u043a\u0436\u0435 \u0441\u0442\u043e\u0438\u0442 \u043e\u0442\u043c\u0435\u0442\u0438\u0442\u044c, \u0447\u0442\u043e \u043d\u0430 \u043c\u043e\u043c\u0435\u043d\u0442 \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u0438\u044f \u0441\u0442\u0430\u0442\u044c\u0438 \u0435\u0441\u0442\u044c \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043e\u043f\u0430\u0441\u0435\u043d\u0438\u044f \u043f\u043e \u043f\u043e\u0432\u043e\u0434\u0443 AVX-512, \u043a\u0442\u043e \u0445\u043e\u0440\u043e\u0448\u043e \u043f\u043e\u0434\u043a\u043e\u0432\u0430\u043d \u0432 \u0432\u043e\u043f\u0440\u043e\u0441\u0435, \u043d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u043e\u0436\u0430\u043b\u0443\u0439\u0441\u0442\u0430 \u0432 \u043a\u043e\u043c\u043c\u0435\u043d\u0442\u0430\u0440\u0438\u044f\u0445.<\/p>\n<\/li>\n<\/ul>\n<h3>\u0412\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0440\u0430\u043d\u0433\u0430\/\u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u043d\u0430 512 \u0431\u0438\u0442\u0430\u0445<\/h3>\n<p>SIMD within a register(SWAR)\/broadword programming \u2014 \u0442\u0435\u0440\u043c\u0438\u043d\u044b \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u043d\u0430 \u0434\u0430\u043d\u043d\u044b\u0445 \u0440\u0430\u0437\u043c\u0435\u0440\u0430 \u043c\u0430\u0448\u0438\u043d\u043d\u043e\u0433\u043e \u0441\u043b\u043e\u0432\u0430. \u041a\u0430\u043d\u043e\u043d\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043f\u0440\u0438\u043c\u0435\u0440 \u2014 <a href=\"https:\/\/godbolt.org\/z\/xrYMP5KbG\" rel=\"noopener noreferrer nofollow\">\u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u0435\u0434\u0438\u043d\u0438\u0447\u043d\u044b\u0445 \u0431\u0438\u0442\u043e\u0432<\/a> \u0432 \u0446\u0435\u043b\u043e\u043c \u0447\u0438\u0441\u043b\u0435 (\u043a\u0430\u043a \u0440\u0430\u0437 \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043c \u043d\u0443\u0436\u043d\u043e \u0434\u043b\u044f \u0440\u0430\u043d\u0433\u0430)<\/p>\n<pre><code class=\"cpp\">uint64_t popcount64(uint64_t x) {     x = x - ((x &gt;&gt; 1) &amp; 0x5555555555555555ULL);                    x = (x &amp; 0x3333333333333333ULL) + ((x &gt;&gt; 2) &amp; 0x3333333333333333ULL);     x = (x + (x &gt;&gt; 4)) &amp; 0x0F0F0F0F0F0F0F0FULL;                    x = x * 0x0101010101010101ULL;                                 return x &gt;&gt; 56;                                            } <\/code><\/pre>\n<p>\u0421\u0435\u0439\u0447\u0430\u0441 \u044d\u0442\u043e\u0442 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0435 \u0438\u043c\u0435\u0435\u0442 \u0431\u043e\u043b\u044c\u0448\u043e\u0433\u043e \u043f\u0440\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u043e\u0433\u043e \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0441\u043e\u0432\u0440\u0435\u043c\u0435\u043d\u043d\u044b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u044b \u043f\u0440\u0435\u0434\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u044e\u0442 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044e POPCNT, \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u0442 \u0431\u044b\u0441\u0442\u0440\u0435\u0435, \u043d\u043e \u0435\u0441\u043b\u0438 \u0432\u0434\u0440\u0443\u0433 \u043f\u043e \u043a\u0430\u043a\u043e\u0439-\u0442\u043e \u043f\u0440\u0438\u0447\u0438\u043d\u0435 \u043e\u043d\u0430 \u043d\u0435\u0434\u043e\u0441\u0442\u0443\u043f\u043d\u0430, \u0442\u043e \u044d\u0442\u043e\u0442 \u043a\u043e\u0434 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u0434\u0438\u0442\u0435\u043b\u0435\u043d \u0438\u0437 \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f \u0430\u043b\u044c\u0442\u0435\u0440\u043d\u0430\u0442\u0438\u0432. C SIMD \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u043c \u0435\u0441\u0442\u044c \u043f\u0430\u0440\u0430 \u043d\u044e\u0430\u043d\u0441\u043e\u0432. \u0427\u0442\u043e\u0431\u044b \u0441\u0434\u0435\u043b\u0430\u0442\u044c popcount \u043f\u0435\u0440\u0432\u044b\u0445 <code>count<\/code> \u0431\u0438\u0442 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0447\u0442\u043e-\u0442\u043e \u0442\u0430\u043a\u043e\u0435<em>:<\/em><\/p>\n<pre><code class=\"cpp\">uint64_t rank_64(uint64_t x, uint64_t count) {   \/\/ \u043d\u0435 \u0437\u0430\u0431\u0443\u0434\u044c\u0442\u0435, \u0447\u0442\u043e \u043f\u0440\u0438 count &gt;= 64 1ull &lt;&lt; count -- \u044d\u0442\u043e UB   \/\/ \u0432 \u044d\u0442\u043e\u043c \u043a\u043e\u043d\u0442\u0435\u043a\u0441\u0442\u0435 \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0434\u043e\u0440\u043e\u0433\u0430\u044f \u0438 \u043e\u0441\u0442\u0430\u0451\u0442\u0441\u044f \u043d\u0430 \u0443\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0438\u0435   \/\/ \u0440\u0430\u0437\u0440\u0430\u0431\u043e\u0442\u0447\u0438\u043a\u0430   return std::popcount(x &amp; ((1ull &lt;&lt; count) - 1)); } <\/code><\/pre>\n<p>SIMD \u0432\u0430\u0440\u0438\u0430\u043d\u0442 \u2014 \u044d\u0442\u043e \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0438 <code>mmXpopcnt_epi64<\/code>\u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u0434\u043b\u044f \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u0438\u0445 64-\u0431\u0438\u0442\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b +  <code>mmXreduce_add_epi64<\/code>\u0434\u043b\u044f \u0441\u0443\u043c\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0430. \u0418 \u0442\u0443\u0442 \u0432\u043d\u0435\u0437\u0430\u043f\u043d\u043e \u043e\u043a\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f, \u0447\u0442\u043e \u043f\u043e\u0434\u0441\u0447\u0435\u0442 \u043c\u0430\u0441\u043a\u0438 <code>((1 &lt;&lt; count) - 1))<\/code>\u0434\u043b\u044f <code>count \u2265 64<\/code>\u043e\u0434\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u043d\u0435 \u043f\u043e\u043b\u0443\u0447\u0438\u0442\u0441\u044f. \u041e\u0434\u043d\u043e\u0439 \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u0435\u0439 \u043c\u043e\u0436\u043d\u043e \u0441\u0434\u0435\u043b\u0430\u0442\u044c \u0434\u043b\u044f <code>count=8k<\/code>, \u043d\u043e \u0434\u043b\u044f \u043e\u0441\u0442\u0430\u0432\u0448\u0438\u0445\u0441\u044f 8 \u0431\u0438\u0442 \u043f\u0440\u0438\u0445\u043e\u0434\u0438\u0442\u0441\u044f \u0447\u0442\u043e-\u0442\u043e \u043f\u0440\u0438\u0434\u0443\u043c\u044b\u0432\u0430\u0442\u044c, \u043b\u0443\u0447\u0448\u0435\u0435 \u0447\u0442\u043e \u044f \u043d\u0430\u0448\u0435\u043b &#8212;  \u0438\u043d\u0441\u0442\u0440\u0443\u043a\u0446\u0438\u044f <code>shldv(a, b, k)<\/code>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0431\u0435\u0440\u0451\u0442 \u0434\u0432\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u0438 \u0447\u0438\u0441\u0435\u043b a, b \u0438 \u0441\u043e\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0438\u0437 \u043d\u0438\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0441\u0442\u044c \u0441, \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 &#8212; \u044d\u0442\u043e k \u0432\u0435\u0440\u0445\u043d\u0438\u0445 \u0431\u0438\u0442 b \u0438 (x-k) \u043c\u043b\u0430\u0434\u0448\u0438\u0445 \u0431\u0438\u0442 a, \u0432 \u0438\u0442\u043e\u0433\u0435 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u043e\u0442 \u0442\u0430\u043a\u043e\u0435<\/p>\n<pre><code class=\"cpp\">uint64_t rank_512(uint64_t *x, uint64_t count) {   __m512i a = _mm512_maskz_set1_epi64((1ull &lt;&lt; ((count &gt;&gt; 6))) - 1,                                       std::numeric_limits&lt;uint64_t&gt;::max());   __m512i b = _mm512_maskz_set1_epi64((1ull &lt;&lt; ((count &gt;&gt; 6) + 1)) - 1,                                       std::numeric_limits&lt;uint64_t&gt;::max());   __m512i mask = _mm512_shldv_epi64(a, b, _mm512_set1_epi64(count % 64));    __m512i res = _mm512_load_epi64(x);   res = _mm512_and_epi64(res, mask);   __m512i cnt = _mm512_popcnt_epi64(res);   return _mm512_reduce_add_epi64(cnt); }<\/code><\/pre>\n<p>\u0414\u043b\u044f \u043f\u043e\u0434\u0441\u0447\u0451\u0442\u0430 \u0441\u0435\u043b\u0435\u043a\u0442\u0430 \u0435\u0441\u0442\u044c SWAR \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435<\/p>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\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-471873","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471873","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=471873"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/471873\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=471873"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=471873"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=471873"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}