{"id":274353,"date":"2016-02-16T11:14:02","date_gmt":"2016-02-16T08:14:02","guid":{"rendered":"http:\/\/savepearlharbor.com\/?p=274353"},"modified":"-0001-11-30T00:00:00","modified_gmt":"-0001-11-29T21:00:00","slug":"","status":"publish","type":"post","link":"https:\/\/savepearlharbor.com\/?p=274353","title":{"rendered":"\u0421\u0435\u0442\u044c \u043e\u0431\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043e \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u0411\u044d\u0442\u0447\u0435\u0440\u0430"},"content":{"rendered":"<p>       \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u0448\u0438\u0440\u043e\u043a\u043e\u043c \u0441\u043f\u0435\u043a\u0442\u0440\u0435 \u0437\u0430\u0434\u0430\u0447. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 <b>\u0441\u0435\u0442\u044c \u043e\u0431\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043e \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u0411\u044d\u0442\u0447\u0435\u0440\u0430<\/b> \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/2e9\/b3a\/459\/2e9b3a45980f421a8a48bf426fa9c6d4.png\"\/><a name=\"habracut\"><\/a><\/p>\n<h1>\u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435<\/h1>\n<p>  <i>\u0421\u0435\u0442\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438<\/i> \u2013 \u044d\u0442\u043e \u0432\u0438\u0434 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438, \u0432 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e\u0440\u044f\u0434\u043e\u043a \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u044f \u0438 \u0438\u0445 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0435 \u0437\u0430\u0432\u0438\u0441\u0438\u0442 \u043e\u0442 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u041e\u043d\u0438 \u043f\u043e\u0437\u0432\u043e\u043b\u044f\u044e\u0442 \u0441\u043e\u0437\u0434\u0430\u0432\u0430\u0442\u044c \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<p>  \u0412 \u0441\u0435\u0442\u044f\u0445 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u0435\u0442\u0441\u044f <i>\u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430\u043c\u0438<\/i>, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u044e\u0442 \u0434\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0438, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438, \u043c\u0435\u043d\u044f\u044e\u0442 \u0438\u0445 \u043c\u0435\u0441\u0442\u0430\u043c\u0438.<\/p>\n<p>  \u0421\u0435\u0442\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043f\u0440\u0438\u043d\u044f\u0442\u043e \u0438\u0437\u043e\u0431\u0440\u0430\u0436\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c. \u0421\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u044b\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442\u0441\u044f \u0433\u043e\u0440\u0438\u0437\u043e\u043d\u0442\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043b\u0438\u043d\u0438\u044f\u043c\u0438 \u0434\u0430\u043d\u043d\u044b\u0445, \u0430 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u044b \u2013 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u043c\u0438 \u043e\u0442\u0440\u0435\u0437\u043a\u0430\u043c\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u043e\u0435\u0434\u0438\u043d\u044f\u044e\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0434\u0432\u0435 \u043b\u0438\u043d\u0438\u0438. \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 1 \u043d\u0438\u0436\u0435 \u043f\u043e\u043a\u0430\u0437\u0430\u043d\u0430 \u0441\u0435\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043b\u044f \u0442\u0440\u0435\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438 \u043f\u0440\u0438\u043c\u0435\u0440 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/639\/c4b\/1c5\/639c4b1c58c14b1db645912f7fc37caf.png\"\/>. \u0417\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u0439 \u043b\u0438\u043d\u0438\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043f\u043e \u043c\u0435\u0440\u0435 \u0441\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u043d\u0438\u044f \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u044e\u0449\u0435\u0433\u043e \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/70a\/e67\/d9a\/70ae67d9af9949b59374c09b9f17c6a5.png\"\/><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 1. \u0421\u0435\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0437 3 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/i><\/p>\n<p>  \u041d\u0430 \u0434\u0430\u043d\u043d\u044b\u0439 \u043c\u043e\u043c\u0435\u043d\u0442 \u0441\u043f\u043e\u0441\u043e\u0431 \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0435\u0439, \u043e\u0431\u043b\u0430\u0434\u0430\u044e\u0449\u0438\u0445 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u043c \u0432\u0440\u0435\u043c\u0435\u043d\u0435\u043c \u0434\u043b\u044f \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0447\u0438\u0441\u043b\u0430 \u0432\u0445\u043e\u0434\u043e\u0432, \u043d\u0435\u0438\u0437\u0432\u0435\u0441\u0442\u0435\u043d, \u043f\u043e\u044d\u0442\u043e\u043c\u0443 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043e\u0434\u043d\u0443 \u0438\u0437 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0445 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u0435\u0442\u0435\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438.<\/p>\n<h1>\u0421\u0435\u0442\u044c \u043e\u0431\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043e \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u0411\u044d\u0442\u0447\u0435\u0440\u0430<\/h1>\n<p>  \u0421\u0435\u0442\u0438 \u0411\u044d\u0442\u0447\u0435\u0440\u0430 \u2013 \u043d\u0430\u0438\u0431\u043e\u043b\u0435\u0435 \u0431\u044b\u0441\u0442\u0440\u043e\u0434\u0435\u0439\u0441\u0442\u0432\u0443\u044e\u0449\u0438\u0435 \u0438\u0437 \u043c\u0430\u0441\u0448\u0442\u0430\u0431\u0438\u0440\u0443\u0435\u043c\u044b\u0445 \u0441\u0435\u0442\u0435\u0439. \u0414\u043b\u044f \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0438 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0439 \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u044b\u0439 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c.<\/p>\n<p>  \u041f\u0440\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0437 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/d8f\/09a\/b77\/d8f09ab7731746fd9bb34f9424adb973.png\"\/> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0df\/162\/369\/0df1623697414cb5aa7c847fa5d78c5a.png\"\/> \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u0440\u0430\u0437\u0434\u0435\u043b\u0438\u0442\u044c \u0435\u0433\u043e \u043d\u0430 \u0434\u0432\u0435 \u0447\u0430\u0441\u0442\u0438: \u0432 \u043f\u0435\u0440\u0432\u043e\u0439 \u043e\u0441\u0442\u0430\u0432\u0438\u0442\u044c <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9ba\/90b\/caf\/9ba90bcaff0f4716ab5869b5491b966a.png\"\/> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/a72\/79c\/55b\/a7279c55b365416aa3760e2da4b0e7ad.png\"\/>, \u0430 \u0432\u043e \u0432\u0442\u043e\u0440\u043e\u0439 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/041\/a95\/2f4\/041a952f49eb418d83bbf459b600ec6f.png\"\/> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0a9\/f26\/442\/0a9f264424974c91bb4167d2e864e4b2.png\"\/>. \u0414\u0430\u043b\u0435\u0435 \u0441\u043b\u0435\u0434\u0443\u0435\u0442 \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u0442\u044c \u043a\u0430\u0436\u0434\u0443\u044e \u0438\u0437 \u0447\u0430\u0441\u0442\u0435\u0439 (\u0444\u0443\u043d\u043a\u0446\u0438\u044f <i><b>B<\/b><\/i>) \u0438 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0438\u0442\u044c \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 (\u0444\u0443\u043d\u043a\u0446\u0438\u044f <i><b>S<\/b><\/i>).<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0434\u0430\u043d\u043d\u044b\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.<\/p>\n<p>  <i><b>B<\/b><\/i>(<i>array<\/i>) \u2013 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u043f\u043e\u0441\u0442\u0440\u043e\u0435\u043d\u0438\u044f \u0441\u0435\u0442\u0438 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0433\u0440\u0443\u043f\u043f\u044b \u043b\u0438\u043d\u0438\u0439. \u0420\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e \u0434\u0435\u043b\u0438\u0442 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 \u0434\u0432\u0430 \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u0430 <i>up<\/i> \u0438 <i>down<\/i> \u0438\u0437 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/423\/9d9\/f0b\/4239d9f0bae04bb0b6f2057b0963c87f.png\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4ad\/2f5\/b70\/4ad2f5b702a04cb6ae9180381946f4fd.png\"\/> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0435\u043d\u043d\u043e, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0432\u044b\u0437\u044b\u0432\u0430\u0435\u0442 \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043b\u0438\u044f\u043d\u0438\u044f <i><b>S<\/b><\/i> \u0434\u043b\u044f \u044d\u0442\u0438\u0445 \u043f\u043e\u0434\u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432.<\/p>\n<p>  <i><b>S<\/b><\/i>(<i>up<\/i>, <i>down<\/i>) \u2013 \u0444\u0443\u043d\u043a\u0446\u0438\u044f \u0440\u0435\u043a\u0443\u0440\u0441\u0438\u0432\u043d\u043e\u0433\u043e \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0433\u0440\u0443\u043f\u043f \u043b\u0438\u043d\u0438\u0439. \u0412 \u0441\u0435\u0442\u0438 \u043d\u0435\u0447\u0435\u0442\u043d\u043e-\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u044f\u044e\u0442\u0441\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u0441 \u043d\u0435\u0447\u0435\u0442\u043d\u044b\u043c\u0438 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 \u0438 \u043e\u0442\u0434\u0435\u043b\u044c\u043d\u043e \u0441 \u0447\u0435\u0442\u043d\u044b\u043c\u0438, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0437\u0430\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u043f\u0430\u0440\u044b \u0441\u043e\u0441\u0435\u0434\u043d\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441 \u043d\u043e\u043c\u0435\u0440\u0430\u043c\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/20b\/7c8\/0c4\/20b7c80c45ad4b08a25870c76e58885d.png\"\/>, \u0433\u0434\u0435 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/8fb\/334\/c93\/8fb334c930184a7cb885e7b8c87bfc6b.png\"\/> \u2013 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 \u043e\u0442 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/16c\/4e3\/d0c\/16c4e3d0cef14d0bb9038d735fe8c1cd.png\"\/> \u0434\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/48a\/414\/d46\/48a414d460774bcd824119dafdaef9d7.png\"\/>. \u0414\u0430\u043d\u043d\u044b\u0435 \u043f\u0430\u0440\u044b \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442\u0441\u044f \u0432 \u043c\u0430\u0441\u0441\u0438\u0432 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u043e\u0432 <i>comparators<\/i> \u0434\u043b\u044f \u0434\u0430\u043b\u044c\u043d\u0435\u0439\u0448\u0435\u0433\u043e \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f.<\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 B \u0438 S<\/b><\/p>\n<div class=\"spoiler_text\">\u0417\u0434\u0435\u0441\u044c \u0438 \u0434\u0430\u043b\u0435\u0435 \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438\u0432\u043e\u0434\u0438\u0442\u044c \u043f\u0440\u0438\u043c\u0435\u0440\u044b \u043a\u043e\u0434\u0430 \u043d\u0430 \u0421\u0438 \u0441\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c\u0438 \u0441\u043e\u0433\u043b\u0430\u0448\u0435\u043d\u0438\u044f\u043c\u0438.  <\/p>\n<ol>\n<li>\u041c\u0430\u0441\u0441\u0438\u0432\u044b \u0442\u0438\u043f\u0430 T \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442\u0441\u044f \u043a\u0430\u043a array(T).<\/li>\n<li>\u0421\u0447\u0438\u0442\u0430\u0435\u043c, \u0447\u0442\u043e \u0432\u0441\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u0441 \u043c\u0430\u0441\u0441\u0438\u0432\u0430\u043c\u0438 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u044b \u0432 \u043a\u0430\u043a\u043e\u043c-\u043d\u0438\u0431\u0443\u0434\u044c <i>array.h<\/i> \u0438 \u0434\u0435\u043b\u0430\u044e\u0442 \u0440\u043e\u0432\u043d\u043e \u0442\u043e, \u0447\u0442\u043e \u043d\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u0432 \u043d\u0430\u0437\u0432\u0430\u043d\u0438\u0438.<\/li>\n<li>\u041a\u0440\u043e\u043c\u0435 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>array_push()<\/i>: \u0434\u043b\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u043e\u0432 \u043e\u043d\u0430 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u0432 \u043a\u043e\u043d\u0435\u0446 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u043f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0432\u044b\u0434\u0435\u043b\u044f\u044f \u043f\u0430\u043c\u044f\u0442\u044c; \u0434\u043b\u044f \u043e\u0431\u044b\u0447\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432 \u2014 \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442 \u043f\u0435\u0440\u0435\u0434\u0430\u043d\u043d\u043e\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043f\u043e\u0441\u043b\u0435 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0433\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043d\u043e\u0433\u043e, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043d\u0443\u043b\u0435\u0432\u043e\u0433\u043e.<\/li>\n<\/ol>\n<p>  <\/p>\n<pre><code class=\"cpp\">void S(array(int) procs_up, array(int) procs_down) {     int proc_count = array_size(procs_up) + array_size(procs_down);     if (proc_count == 1) {         return;     } else if (proc_count == 2) {         array_push(&comparators, ((pair_t){ procs_up[0], procs_down[0] }));         return;     }          array(int) procs_up_odd = array_new(array_size(procs_up) \/ 2 + array_size(procs_up) % 2, int);     array(int) procs_down_odd = array_new(array_size(procs_down) \/ 2 + array_size(procs_down) % 2, int);     array(int) procs_up_even = array_new(array_size(procs_up) \/ 2, int);     array(int) procs_down_even = array_new(array_size(procs_down) \/ 2, int);     array(int) procs_result = array_new(array_size(procs_up) + array_size(procs_down), int);          for (int i = 0; i &lt; array_size(procs_up); i++) {         if (i % 2) {             array_push(&procs_up_even, procs_up[i]);         } else {             array_push(&procs_up_odd, procs_up[i]);         }     }     for (int i = 0; i &lt; array_size(procs_down); i++) {         if (i % 2) {             array_push(&procs_down_even, procs_down[i]);         } else {             array_push(&procs_down_odd, procs_down[i]);         }     }          S(procs_up_odd, procs_down_odd);     S(procs_up_even, procs_down_even);          array_concatenate(&procs_result, procs_up, procs_down);      for (int i = 1; i + 1 &lt; array_size(procs_result); i += 2) {         array_push(&comparators, ((pair_t){ procs_result[i], procs_result[i + 1] }));     }          array_delete(&procs_up_odd);     array_delete(&procs_down_odd);     array_delete(&procs_up_even);     array_delete(&procs_down_even);     array_delete(&procs_result); }  void B(array(int) procs) {     if (array_size(procs) == 1) {         return;     }          array(int) procs_up = array_new(array_size(procs) \/ 2, int);     array(int) procs_down = array_new(array_size(procs) \/ 2 + array_size(procs) % 2, int);          array_copy(procs_up, procs, 0, array_size(procs_up));     array_copy(procs_down, procs, array_size(procs_up), array_size(procs_down));          B(procs_up);     B(procs_down);     S(procs_up, procs_down);          array_delete(&procs_up);     array_delete(&procs_down); }<\/code><\/pre>\n<p>  \u041a\u043e\u0434 \u0444\u0443\u043d\u043a\u0446\u0438\u0439 \u0441 \u043d\u043e\u0440\u043c\u0430\u043b\u044c\u043d\u043e\u0439 \u043f\u043e\u0434\u0441\u0432\u0435\u0442\u043a\u043e\u0439 \u0441\u0438\u043d\u0442\u0430\u043a\u0441\u0438\u0441\u0430 \u043d\u0430 <a href=\"https:\/\/github.com\/zodinyac\/batcher-sort\/blob\/master\/batcher\/batcher.c#L53\">\u0433\u0438\u0442\u0445\u0430\u0431\u0435<\/a>.<\/div>\n<\/div>\n<p>  \u041f\u0440\u0438\u0432\u0435\u0434\u0435\u043c \u043f\u0440\u0438\u043c\u0435\u0440\u044b.<\/p>\n<h2>\u041f\u0435\u0440\u0432\u044b\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<\/h2>\n<p>  \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 2 \u043d\u0438\u0436\u0435 \u043f\u0440\u0435\u0434\u0441\u0442\u0430\u0432\u043b\u0435\u043d\u0430 \u0441\u0435\u0442\u044c \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0437 6 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0441\u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u0437\u043e\u0432\u0430 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i><b>B<\/b><\/i>(<img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/12f\/e23\/f38\/12fe23f38fbc458ca2cf6c74b1e3248b.png\"\/>).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/0a2\/9ee\/8e7\/0a29ee8e75a140f6b9365f53ffd7373d.png\"\/><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 2. \u0421\u0435\u0442\u044c \u0411\u044d\u0442\u0447\u0435\u0440\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0438\u0437 6 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/i><\/p>\n<p>  \u041f\u0440\u0438 \u044d\u0442\u043e\u043c \u0441\u043f\u0438\u0441\u043e\u043a \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u0432 \u043f\u043e\u0440\u044f\u0434\u043a\u0435 \u0438\u0445 \u0444\u043e\u0440\u043c\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u044f \u0444\u0443\u043d\u043a\u0446\u0438\u0435\u0439 S \u0431\u0443\u0434\u0435\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c:  <\/p>\n<ol>\n<li>(2, 3),<\/li>\n<li>(1, 2),<\/li>\n<li>(2, 3),<\/li>\n<li>(5, 6),<\/li>\n<li>(4, 5),<\/li>\n<li>(5, 6),<\/li>\n<li>(1, 4),<\/li>\n<li>(3, 6),<\/li>\n<li>(3, 4),<\/li>\n<li>(2, 5),<\/li>\n<li>(2, 3),<\/li>\n<li>(4, 5).<\/li>\n<\/ol>\n<p>  <\/p>\n<h2>\u0412\u0442\u043e\u0440\u043e\u0439 \u043f\u0440\u0438\u043c\u0435\u0440.<\/h2>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u0440\u0438\u043c\u0435\u0440 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u0434\u0432\u0443\u0445 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432: <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/71f\/c66\/357\/71fc6635775d49bd8c3194268b34151b.png\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/2c2\/538\/211\/2c25382118d745a9997c145334b02fef.png\"\/>. \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 3 \u043d\u0438\u0436\u0435 \u0432\u0435\u0440\u0442\u0438\u043a\u0430\u043b\u044c\u043d\u044b\u0435 \u0431\u043b\u043e\u043a\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0430\u044e\u0442 \u0441\u0435\u0442\u0438 \u0441\u043b\u0438\u044f\u043d\u0438\u044f, \u043e\u0431\u0440\u0430\u0431\u0430\u0442\u044b\u0432\u0430\u044e\u0449\u0438\u0435 \u043d\u0435\u0447\u0435\u0442\u043d\u044b\u0435 \u0438 \u0447\u0435\u0442\u043d\u044b\u0435 \u0433\u0440\u0443\u043f\u043f\u044b \u0441\u0442\u0440\u043e\u043a \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432.<\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u043d\u0435\u0447\u0435\u0442\u043d\u044b\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/235\/8ee\/4ac\/2358ee4ac1ae4a33b7b8a85862e68fea.png\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/4f4\/dd6\/772\/4f4dd6772cd742f1a44e9eae2c079fac.png\"\/>, \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/f37\/616\/b3b\/f37616b3bb1f49889f29a0df3f721c32.png\"\/>.<\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u043e\u0431\u044a\u0435\u0434\u0438\u043d\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0438\u043c\u0435\u044e\u0449\u0438\u0445 \u0447\u0435\u0442\u043d\u044b\u0435 \u043d\u043e\u043c\u0435\u0440\u0430 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/cb1\/0e2\/814\/cb10e2814d824e7784b34ea9ad765fe4.png\"\/> \u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/9a6\/bdb\/67b\/9a6bdb67ba99420d8b069bb81a3adb99.png\"\/>, \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0435\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/511\/74e\/d93\/51174ed9305f4ef7869eb6dcc8f5c4da.png\"\/>.<\/p>\n<p>  \u0412 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u0435\u043d\u0438\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0435\u0439 \u0433\u0440\u0443\u043f\u043f\u044b \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u043e\u0432 \u043f\u043e\u043b\u0443\u0447\u0435\u043d \u043f\u043e\u043b\u043d\u043e\u0441\u0442\u044c\u044e \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432: <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/e15\/cd9\/ce5\/e15cd9ce5e2f426a8b5ced81f77e6484.png\"\/>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/53c\/5e2\/365\/53c5e2365bcd4eb38cc6cf52feab1395.png\"\/><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 3. \u0421\u0435\u0442\u044c \u043d\u0435\u0447\u0435\u0442\u043d\u043e-\u0447\u0435\u0442\u043d\u043e\u0433\u043e \u0441\u043b\u0438\u044f\u043d\u0438\u044f \u0411\u044d\u0442\u0447\u0435\u0440\u0430.<\/i><\/p>\n<h1>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u043e\u0432<\/h1>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0440\u0430\u0437\u043c\u0435\u0440 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/254\/9ca\/092\/2549ca092c8d4dfaaca46dd6f2b6ab5f.png\"\/>, \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043f\u043e <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/466\/133\/bd8\/466133bd8fa640488320aaa15b7837ca.png\"\/> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0443 \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0432 \u0434\u0432\u0430 \u044d\u0442\u0430\u043f\u0430.  <\/p>\n<ol>\n<li><b>\u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043b\u0438\u043d\u043e\u0439<\/b> <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/284\/c4f\/f57\/284c4ff57bca46b987edff1e42d844d6.png\"\/><b>.<\/b> \u041a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043d\u0435\u0437\u0430\u0432\u0438\u0441\u0438\u043c\u043e \u043e\u0442 \u0434\u0440\u0443\u0433\u0438\u0445 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442 \u043f\u0440\u043e\u0446\u0435\u0441\u0441 \u0443\u043f\u043e\u0440\u044f\u0434\u043e\u0447\u0438\u0432\u0430\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430\u0438\u043b\u0443\u0447\u0448\u0438\u043c \u0438\u0437 \u0434\u043e\u0441\u0442\u0443\u043f\u043d\u044b\u0445 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u043e\u0432.<\/li>\n<li><b>\u0421\u043b\u0438\u044f\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043e\u0442\u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u043d\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430<\/b> \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0440\u0430\u0441\u043f\u0438\u0441\u0430\u043d\u0438\u0435\u043c, \u0437\u0430\u0434\u0430\u043d\u043d\u044b\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u043c\u043e\u0439 \u0441\u0435\u0442\u044c\u044e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/254\/9ca\/092\/2549ca092c8d4dfaaca46dd6f2b6ab5f.png\"\/> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0442\u043e \u0435\u0441\u0442\u044c \u043d\u0430 \u0434\u0430\u043d\u043d\u043e\u043c \u044d\u0442\u0430\u043f\u0435 \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u0433\u043b\u043e\u0431\u0430\u043b\u044c\u043d\u0430\u044f \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430.<\/li>\n<\/ol>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u0442\u043e\u0440\u043e\u0439 \u044d\u0442\u0430\u043f \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435. \u041d\u0430 \u0440\u0438\u0441\u0443\u043d\u043a\u0435 4 \u043d\u0438\u0436\u0435 \u043a\u0430\u0436\u0434\u0430\u044f \u043b\u0438\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0443\u0435\u0442 \u043e\u0434\u043d\u043e\u043c\u0443 <i>\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443<\/i>, \u0430 \u043a\u0430\u0436\u0434\u044b\u0439 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440 \u2013 <i>\u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0443 \u0441\u043b\u0438\u044f\u043d\u0438\u044f<\/i>.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/39a\/f8d\/2a7\/39af8d2a70904259a671a910976a93bf.png\"\/><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 4. \u041f\u0440\u0438\u043c\u0435\u0440 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 {8, 7, 4, 3, 9, 2, 5, 1, 2, 4, 0, 6}, n = 12, p = 4.<\/i><\/p>\n<p>  <i>\u041a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440 \u0441\u043b\u0438\u044f\u043d\u0438\u044f<\/i> \u043f\u0440\u0438\u043d\u0438\u043c\u0430\u0435\u0442 \u043d\u0430 \u0432\u0445\u043e\u0434 \u0434\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e\u0439 \u0434\u043b\u0438\u043d\u044b \u0438 \u043f\u0435\u0440\u0435\u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0432 \u0434\u0432\u0430 \u043d\u043e\u0432\u044b\u0445 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0442\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u0447\u0442\u043e \u043f\u0435\u0440\u0432\u044b\u0439 \u0438\u0437 \u043d\u0438\u0445 \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c\u0438 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438, \u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u2013 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c\u0438.<\/p>\n<p>  \u0412 \u0441\u043b\u0443\u0447\u0430\u0435 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u044f \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u043f\u0430\u043c\u044f\u0442\u0438, \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u044d\u0442\u0430\u043f \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u043a\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u043c\u0435\u0436\u0434\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c\u0438:  <\/p>\n<ul>\n<li>\u043a\u0430\u0436\u0434\u044b\u0439 \u0438\u0437 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 \u043f\u0435\u0440\u0435\u0441\u044b\u043b\u0430\u0435\u0442 \u0441\u0432\u043e\u0439 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443, \u043f\u043e\u0434\u043a\u043b\u044e\u0447\u0435\u043d\u043d\u043e\u043c\u0443 \u043a \u0434\u0440\u0443\u0433\u043e\u043c\u0443 \u0432\u0445\u043e\u0434\u0443 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430,<\/li>\n<li>\u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441 \u043c\u0435\u043d\u044c\u0448\u0438\u043c \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u0432\u044b\u0434\u0435\u043b\u044f\u0435\u0442 \u0438\u0437 \u0434\u0432\u0443\u0445 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u043e\u0432 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/022\/581\/f04\/022581f04ffc459a889a85d55cbff194.png\"\/> \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043d\u043e\u043c\u0435\u0440\u043e\u043c \u2013 <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/022\/581\/f04\/022581f04ffc459a889a85d55cbff194.png\"\/> \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.<\/li>\n<\/ul>\n<p>  \u041f\u0440\u0438 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u0438 \u0431\u0443\u0434\u0435\u043c \u0434\u043e\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u043c\u0438 \u043d\u0443\u043b\u0435\u0432\u044b\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438, \u0447\u0442\u043e\u0431\u044b \u0434\u043b\u0438\u043d\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0431\u044b\u043b\u0430 \u043a\u0440\u0430\u0442\u043d\u0430 \u0447\u0438\u0441\u043b\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u043c\u043e\u0436\u043d\u043e \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u043a\u0430\u043a:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0414\u043b\u044f \u0443\u043f\u0440\u043e\u0449\u0435\u043d\u0438\u044f \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0432\u0441\u0442\u0440\u043e\u0435\u043d\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 <i>qsort()<\/i>. \u0420\u0430\u0437\u043c\u0435\u0440 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a:  <\/p>\n<pre><code class=\"cpp\">int proc_count; \/\/ \u0432\u0441\u0435\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432 int elems_count; \/\/ \u0432\u0441\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 int elems_count_new = elems_count + (elems_count % proc_count ? proc_count - elems_count % proc_count : 0); int elems_per_proc_count = elems_count_new \/ proc_count;<\/code><\/pre>\n<p>  \u0422\u043e\u0433\u0434\u0430 \u043f\u0435\u0440\u0432\u044b\u0439 \u044d\u0442\u0430\u043f \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432\u0441\u0435\u0433\u043e \u0438\u0437 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0438 \u043a\u043e\u0434\u0430:  <\/p>\n<pre><code class=\"cpp\">qsort(elems_result, elems_per_proc_count, array_item_size(elems_result), compare_uint32);<\/code><\/pre>\n<p>  <a href=\"https:\/\/github.com\/zodinyac\/batcher-sort\/blob\/master\/batcher\/batcher.c#L186\">\u041d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435.<\/a><\/div>\n<\/div>\n<p>  \u0410 \u0432\u0442\u043e\u0440\u043e\u0439:  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u044d\u0442\u0430\u043f\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u041a\u0430\u043a \u0443\u0436\u0435 \u0431\u044b\u043b\u043e \u0441\u043a\u0430\u0437\u0430\u043d\u043e, \u0434\u0430\u043d\u043d\u044b\u0439 \u044d\u0442\u0430\u043f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0439 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430 \u0438\u0437 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <i>comparators<\/i>. \u041f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438\u0437 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0432\u0445\u043e\u0434\u0430 \u043a\u043e\u043c\u043f\u0430\u0440\u0430\u0442\u043e\u0440\u0430 \u043e\u0442\u043f\u0440\u0430\u0432\u043b\u044f\u0435\u0442 \u0441\u0432\u043e\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u043d\u0430 \u0432\u0442\u043e\u0440\u043e\u0439 \u0432\u0445\u043e\u0434, \u0434\u0440\u0443\u0433\u043e\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043f\u043e\u0441\u0442\u0443\u043f\u0430\u0435\u0442 \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u043e, \u0432 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442\u0435 \u0447\u0435\u0433\u043e \u043a\u0430\u0436\u0434\u044b\u0439 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0438\u043c\u0435\u0435\u0442 \u0434\u0432\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430: \u0441\u0432\u043e\u0439 (<i>elems_result<\/i>) \u0438 \u0434\u0440\u0443\u0433\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 (<i>elems_current<\/i>).<\/p>\n<p>  \u0417\u0430\u0442\u0435\u043c \u043d\u0430 \u043a\u0430\u0436\u0434\u043e\u043c \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0435 \u0444\u043e\u0440\u043c\u0438\u0440\u0443\u0435\u0442\u0441\u044f \u0442\u0440\u0435\u0442\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 (<i>elems_temp<\/i>), \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0438\u0439 \u0438\u0437 \u043d\u0430\u0438\u043c\u0435\u043d\u044c\u0448\u0438\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (\u0434\u043b\u044f \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430) \u0438\u043b\u0438 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0438\u0445 (\u0434\u043b\u044f \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430).<\/p>\n<p>  \u041f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432 <i>elems_temp<\/i> \u0437\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u043d\u0430 \u043c\u0435\u0441\u0442\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 <i>elems_result<\/i>.<\/p>\n<pre><code class=\"cpp\">for (int i = 0; i &lt; array_size(comparators); i++) {     pair_t comparator = comparators[i];     if (rank == comparator.a) {         MPI_Send(elems_result, elems_per_proc_count, MPI_UNSIGNED, comparator.b, 0, MPI_COMM_WORLD);         MPI_Recv(elems_current, elems_per_proc_count, MPI_UNSIGNED, comparator.b, 0, MPI_COMM_WORLD, &status);                  for (int res_index = 0, cur_index = 0, tmp_index = 0; tmp_index &lt; elems_per_proc_count; tmp_index++) {             uint32_t result = elems_result[res_index];             uint32_t current = elems_current[cur_index];             if (result &lt; current) {                 elems_temp[tmp_index] = result;                 res_index++;             } else {                 elems_temp[tmp_index] = current;                 cur_index++;             }         }                  swap_ptr(&elems_result, &elems_temp);     } else if (rank == comparator.b) {         MPI_Recv(elems_current, elems_per_proc_count, MPI_UNSIGNED, comparator.a, 0, MPI_COMM_WORLD, &status);         MPI_Send(elems_result, elems_per_proc_count, MPI_UNSIGNED, comparator.a, 0, MPI_COMM_WORLD);                  int start = elems_per_proc_count - 1;         for (int res_index = start, cur_index = start, tmp_index = start; tmp_index &gt;= 0; tmp_index--) {             uint32_t result = elems_result[res_index];             uint32_t current = elems_current[cur_index];             if (result &gt; current) {                 elems_temp[tmp_index] = result;                 res_index--;             } else {                 elems_temp[tmp_index] = current;                 cur_index--;             }         }                  swap_ptr(&elems_result, &elems_temp);     } }<\/code><\/pre>\n<p>  <a href=\"https:\/\/github.com\/zodinyac\/batcher-sort\/blob\/master\/batcher\/batcher.c#L187\">\u041d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435.<\/a><\/div>\n<\/div>\n<p>  <\/p>\n<h1>\u041e\u0441\u043e\u0431\u0435\u043d\u043d\u043e\u0441\u0442\u0438 \u0432\u0432\u043e\u0434\u0430-\u0432\u044b\u0432\u043e\u0434\u0430<\/h1>\n<p>  \u0414\u043b\u044f \u0432\u0432\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>MPI_File_read_ordered()<\/i>, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u0442 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0440\u0430\u0432\u043d\u044b\u0435 \u0444\u0440\u0430\u0433\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. \u0412 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0434\u0430\u043d\u043d\u044b\u0445 \u0438\u0437 \u0444\u0430\u0439\u043b\u0430 \u0431\u0443\u0434\u0435\u0442 \u043d\u0435\u0434\u043e\u0441\u0442\u0430\u0442\u043e\u0447\u043d\u043e, \u043e\u043d\u0430 \u043d\u0435 \u0437\u0430\u0442\u0440\u0435\u0442 \u0444\u0438\u043a\u0442\u0438\u0432\u043d\u044b\u0435 \u043d\u0443\u043b\u0438, \u043a\u043e\u0442\u043e\u0440\u044b\u043c\u0438 \u0438\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0438\u0440\u043e\u0432\u0430\u043d \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<p>  \u0414\u043b\u044f \u0432\u044b\u0432\u043e\u0434\u0430 \u0431\u0443\u0434\u0435\u043c \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u0442\u044c \u0430\u043d\u0430\u043b\u043e\u0433\u0438\u0447\u043d\u0443\u044e \u0444\u0443\u043d\u043a\u0446\u0438\u044e <i>MPI_File_write_ordered()<\/i>, \u043e\u0434\u043d\u0430\u043a\u043e \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0441\u0447\u0438\u0442\u044b\u0432\u0430\u0442\u044c, \u0441\u043a\u043e\u043b\u044c\u043a\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043e\u043d \u0434\u043e\u043b\u0436\u0435\u043d \u0437\u0430\u043f\u0438\u0441\u0430\u0442\u044c \u0432 \u0444\u0430\u0439\u043b. \u0422\u0430\u043a\u0430\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0441\u0442\u044c \u0432\u043e\u0437\u043d\u0438\u043a\u0430\u0435\u0442 \u0432 \u0441\u043b\u0443\u0447\u0430\u0435, \u0435\u0441\u043b\u0438 \u0434\u043b\u0438\u043d\u0430 \u0441\u043e\u0440\u0442\u0438\u0440\u0443\u0435\u043c\u043e\u0433\u043e \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0431\u044b\u043b\u0430 \u043d\u0435 \u043a\u0440\u0430\u0442\u043d\u0430 \u0447\u0438\u0441\u043b\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432.<\/p>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u043f\u043e\u0434\u0440\u043e\u0431\u043d\u0435\u0435.  <\/p>\n<div class=\"spoiler\"><b class=\"spoiler_title\">\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0432\u044b\u0432\u043e\u0434\u0430<\/b><\/p>\n<div class=\"spoiler_text\">\u0418\u0434\u0435\u044f \u0437\u0430\u043a\u043b\u044e\u0447\u0430\u0435\u0442\u0441\u044f \u0432 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c. \u041f\u0443\u0441\u0442\u044c \u0443 \u043d\u0430\u0441 \u0435\u0441\u0442\u044c \u043c\u0430\u0441\u0441\u0438\u0432 \u0438\u0437 15 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e 3 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u043d\u0430 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>elems_per_proc_count<\/i>) (\u0440\u0438\u0441\u0443\u043d\u043e\u043a 5 \u043d\u0438\u0436\u0435). \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u0442\u0438\u0442\u044c \u043f\u0435\u0440\u0432\u044b\u0435 5 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>skip<\/i>).<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/15f\/eed\/68e\/15feed68e7b84d399ac22a4fc529d8f8.png\"\/><br \/>  <i>\u0420\u0438\u0441\u0443\u043d\u043e\u043a 5. \u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0430\u0441\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430\u043c. \u041d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u0432\u044b\u0432\u0435\u0441\u0442\u0438 \u043e\u0431\u0432\u0435\u0434\u0435\u043d\u043d\u044b\u0435 \u0441\u0438\u043d\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b.<\/i><\/p>\n<p>  \u0414\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0431\u0443\u0434\u0435\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0442\u044c \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>print_offset<\/i>) \u043e\u0442\u043d\u043e\u0441\u0438\u0442\u0435\u043b\u044c\u043d\u043e \u043d\u0430\u0447\u0430\u043b\u0430 \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e \u043d\u0430\u0447\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434, \u0430 \u0442\u0430\u043a\u0436\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 (\u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0430\u044f <i>print_count<\/i>).<\/p>\n<p>  \u0412\u043e\u0437\u043c\u043e\u0436\u043d\u044b \u0442\u0440\u0438 \u0441\u043b\u0443\u0447\u0430\u044f.  <\/p>\n<ol>\n<li><b>\u041f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u043d\u0435 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043d\u0438\u0447\u0435\u0433\u043e,<\/b> \u0442. \u0435. \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u2014 \u043d\u043e\u043b\u044c, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u2014 \u043d\u043e\u043b\u044c.<\/li>\n<li><b>\u041f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u043d\u0435\u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u0441\u0432\u043e\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b,<\/b> \u0442. \u0435. \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u2014 \u0447\u0438\u0441\u043b\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u2014 \u0440\u0430\u0437\u043d\u043e\u0441\u0442\u044c <i>elems_per_proc_count<\/i> \u0438 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f.<\/li>\n<li><b>\u041f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0432\u0441\u0435 \u0441\u0432\u043e\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430,<\/b> \u0442. \u0435. \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u2014 \u043d\u043e\u043b\u044c, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u2014 <i>elems_per_proc_count<\/i>.<\/li>\n<\/ol>\n<p>  \u0420\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0438\u043c \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u0435 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u044f. \u041e\u0447\u0435\u0432\u0438\u0434\u043d\u043e, \u0447\u0442\u043e \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0435 \u0440\u0430\u0432\u043d\u043e \u043d\u0443\u043b\u044e \u0432\u0441\u0435\u0433\u0434\u0430, \u043a\u0440\u043e\u043c\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430, \u043d\u0430 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u0437\u0430\u043a\u0430\u043d\u0447\u0438\u0432\u0430\u0435\u0442\u0441\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043f\u0440\u043e\u043f\u0443\u0441\u043a\u0430\u0435\u043c\u044b\u0445 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u041d\u043e\u043c\u0435\u0440 \u0442\u0430\u043a\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430 \u0432\u044b\u0447\u0438\u0441\u043b\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u043a \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0435 <i>skip<\/i> \u043a <i>elems_per_proc_count<\/i> \u0441 \u043e\u0442\u0431\u0440\u0430\u0441\u044b\u0432\u0430\u043d\u0438\u0435\u043c \u0434\u0440\u043e\u0431\u043d\u043e\u0439 \u0447\u0430\u0441\u0442\u0438, \u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0443, \u043a\u0430\u043a \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f \u0432 \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c \u043e\u0442\u043d\u043e\u0448\u0435\u043d\u0438\u0438.<\/p>\n<p>  \u0422\u0430\u043a\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c, \u043f\u043e\u0441\u043b\u0435 \u0433\u0440\u0443\u043f\u043f\u0438\u0440\u043e\u0432\u043a\u0438 \u0432\u0441\u0435\u0445 \u0443\u0441\u043b\u043e\u0432\u0438\u0439 \u043f\u043e\u043b\u0443\u0447\u0430\u0435\u043c \u0432\u044b\u0440\u0430\u0436\u0435\u043d\u0438\u0435 \u0434\u043b\u044f <i>print_offset<\/i>.<\/p>\n<p>  \u041f\u043e \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043d\u043e\u043c\u0443 \u043d\u0438\u0436\u0435 \u043a\u043e\u0434\u0443 \u043d\u0435 \u0441\u043e\u0441\u0442\u0430\u0432\u0438\u0442 \u0442\u0440\u0443\u0434\u0430 \u0440\u0430\u0437\u043e\u0431\u0440\u0430\u0442\u044c\u0441\u044f \u0432 \u0444\u043e\u0440\u043c\u0443\u043b\u0435 \u0434\u043b\u044f \u0432\u044b\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432.  <\/p>\n<pre><code class=\"cpp\">\/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0438\u0437 \u043e\u0431\u0449\u0435\u0433\u043e \u0447\u0438\u0441\u043b\u0430, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0435 \u043d\u0443\u0436\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c. int skip = elems_count_new - elems_count;  \/\/ \u041d\u043e\u043c\u0435\u0440 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430, \u0441 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0432\u044b\u0432\u043e\u0434 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. int print_offset = (skip \/ elems_per_proc_count == rank) * (skip % elems_per_proc_count);  \/\/ \u041a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c\u044b\u0445 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. int print_count = (skip \/ elems_per_proc_count &lt;= rank) * elems_per_proc_count - print_offset;  \/\/ \u0427\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0432\u044b\u0432\u043e\u0434\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u0438\u043d \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440 \u0441 \u0440\u0430\u043d\u043a\u043e\u043c 0. MPI_File_write_ordered(output, &elems_count, rank == 0, MPI_UNSIGNED, &status);  \/\/ \u041f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0430 \u043e\u0441\u043d\u043e\u0432\u0435 \u0440\u0430\u0441\u0441\u0447\u0438\u0442\u0430\u043d\u043d\u044b\u0445 \u0441\u043c\u0435\u0449\u0435\u043d\u0438\u0439 \u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432 \u0434\u043b\u044f \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u0430. MPI_File_write_ordered(output, (unsigned char *)elems_result + print_offset * array_item_size(elems_result), print_count, MPI_UNSIGNED, &status);<\/code><\/pre>\n<p>  <a href=\"https:\/\/github.com\/zodinyac\/batcher-sort\/blob\/master\/batcher\/batcher.c#L239\">\u041d\u0430 \u0433\u0438\u0442\u0445\u0430\u0431\u0435.<\/a><\/div>\n<\/div>\n<p>  <\/p>\n<h1>\u0422\u0435\u0441\u0442\u0438\u0440\u043e\u0432\u0430\u043d\u0438\u0435 32-\u0445 \u0431\u0438\u0442\u043d\u043e\u0433\u043e \u043f\u0440\u0438\u043b\u043e\u0436\u0435\u043d\u0438\u044f<\/h1>\n<p>  \u0411\u044b\u043b\u0438 \u0441\u0433\u0435\u043d\u0435\u0440\u0438\u0440\u043e\u0432\u0430\u043d\u044b \u0444\u0430\u0439\u043b\u044b \u0441 \u0441\u043b\u0443\u0447\u0430\u0439\u043d\u044b\u043c\u0438 \u0431\u0435\u0437\u0437\u043d\u0430\u043a\u043e\u0432\u044b\u043c\u0438 \u0446\u0435\u043b\u044b\u043c\u0438 \u0447\u0438\u0441\u043b\u0430\u043c\u0438 \u043d\u0430 \u0440\u0430\u0437\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432, \u043f\u043e\u0441\u043b\u0435 \u0447\u0435\u0433\u043e \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b \u0441\u0440\u0430\u0432\u043d\u0438\u0432\u0430\u043b\u0441\u044f \u0441 \u044d\u0442\u0430\u043b\u043e\u043d\u043d\u044b\u043c \u043e\u0442\u0432\u0435\u0442\u043e\u043c, \u043f\u043e\u043b\u0443\u0447\u0435\u043d\u043d\u044b\u043c \u0441 \u043f\u043e\u043c\u043e\u0449\u044c\u044e \u0441\u0442\u0430\u043d\u0434\u0430\u0440\u0442\u043d\u043e\u0439 \u0444\u0443\u043d\u043a\u0446\u0438\u0438 <i>qsort()<\/i>.<\/p>\n<p>  \u0412 \u0442\u0430\u0431\u043b\u0438\u0446\u0435 \u043d\u0438\u0436\u0435 \u043f\u0440\u0438\u0432\u0435\u0434\u0435\u043d\u043e \u0441\u0440\u0430\u0432\u043d\u0435\u043d\u0438\u0435 \u0441\u043a\u043e\u0440\u043e\u0441\u0442\u0438 \u0440\u0430\u0431\u043e\u0442\u044b \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u043e\u0433\u043e \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u0441 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u043e\u0439 \u0411\u044d\u0442\u0447\u0435\u0440\u0430 \u043d\u0430 \u0440\u0430\u0437\u043d\u043e\u043c \u0447\u0438\u0441\u043b\u0435 \u043f\u0440\u043e\u0446\u0435\u0441\u0441\u043e\u0440\u043e\u0432.<\/p>\n<p>  \u041d\u0430 \u0441\u0442\u0430\u0446\u0438\u043e\u043d\u0430\u0440\u043d\u043e\u0439 \u043c\u0430\u0448\u0438\u043d\u0435 (Intel Core i7-3770 (4 \u044f\u0434\u0440\u0430, 8 \u043f\u043e\u0442\u043e\u043a\u043e\u0432), 8 GB RAM):<br \/>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/522\/3d2\/f73\/5223d2f73f394d7997aebe51caa548ba.png\"\/><br \/>  (\u041f\u0440\u043e\u0447\u0435\u0440\u043a\u0438 \u2013 \u043e\u0448\u0438\u0431\u043a\u0438 \u0432\u044b\u0434\u0435\u043b\u0435\u043d\u0438\u044f \u043d\u0435\u043e\u0431\u0445\u043e\u0434\u0438\u043c\u043e\u0433\u043e \u043e\u0431\u044a\u0435\u043c\u0430 \u043f\u0430\u043c\u044f\u0442\u0438).<\/p>\n<h1>\u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434<\/h1>\n<p>  \u0418\u0441\u0445\u043e\u0434\u043d\u044b\u0439 \u043a\u043e\u0434 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0434\u043e\u0441\u0442\u0443\u043f\u0435\u043d \u043d\u0430 GitHub \u043f\u043e \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u0439 \u0441\u0441\u044b\u043b\u043a\u0435: <a href=\"https:\/\/github.com\/zodinyac\/batcher-sort\">https:\/\/github.com\/zodinyac\/batcher-sort<\/a>. \u0422\u0430\u043c \u0436\u0435 \u043c\u043e\u0436\u043d\u043e \u043d\u0430\u0439\u0442\u0438 \u0433\u0435\u043d\u0435\u0440\u0430\u0442\u043e\u0440 \u0442\u0435\u0441\u0442\u043e\u0432 \u0438 \u0434\u0440\u0443\u0433\u0438\u0435 \u0432\u0441\u043f\u043e\u043c\u043e\u0433\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0435 \u0443\u0442\u0438\u043b\u0438\u0442\u044b, \u043e\u043f\u0438\u0441\u0430\u043d\u043d\u044b\u0435 \u0432 <i>README.md<\/i>.<\/p>\n<h1>\u0418\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u043d\u0430\u044f \u043b\u0438\u0442\u0435\u0440\u0430\u0442\u0443\u0440\u0430<\/h1>\n<p>  <\/p>\n<ol>\n<li>\u042f\u043a\u043e\u0431\u043e\u0432\u0441\u043a\u0438\u0439 \u041c. \u0412. \u041f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u044b \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0431\u043e\u043b\u044c\u0448\u0438\u0445 \u043e\u0431\u044a\u0435\u043c\u043e\u0432 \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<li>\u042f\u043a\u043e\u0431\u043e\u0432\u0441\u043a\u0438\u0439 \u041c. \u0412. \u0412\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u0432 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u044b\u0435 \u043c\u0435\u0442\u043e\u0434\u044b \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447.<\/li>\n<li>\u0422\u044e\u0442\u043b\u044f\u0435\u0432\u0430 \u0415. \u041e. \u0418\u043d\u0442\u0435\u0433\u0440\u0430\u0446\u0438\u044f \u0430\u043b\u0433\u043e\u0440\u0438\u0442\u043c\u0430 \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0411\u044d\u0442\u0447\u0435\u0440\u0430 \u0438 \u0430\u043a\u0442\u0438\u0432\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u044b \u0445\u0440\u0430\u043d\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u044b\u0445.<\/li>\n<\/ol>\n<div class=\"clear\"><\/div>\n<p> \u0441\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u0441\u0442\u0430\u0442\u044c\u0438 <a href=\"https:\/\/habrahabr.ru\/post\/275889\/\"> https:\/\/habrahabr.ru\/post\/275889\/<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>       \u0421\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0430 \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043e\u0434\u043d\u043e\u0439 \u0438\u0437 \u0431\u0430\u0437\u043e\u0432\u044b\u0445 \u043e\u043f\u0435\u0440\u0430\u0446\u0438\u0439 \u043f\u0440\u0438 \u043e\u0431\u0440\u0430\u0431\u043e\u0442\u043a\u0435 \u0434\u0430\u043d\u043d\u044b\u0445, \u043a\u043e\u0442\u043e\u0440\u0430\u044f \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u0443\u0435\u0442\u0441\u044f \u0432 \u0441\u0430\u043c\u043e\u043c \u0448\u0438\u0440\u043e\u043a\u043e\u043c \u0441\u043f\u0435\u043a\u0442\u0440\u0435 \u0437\u0430\u0434\u0430\u0447. \u0412 \u0434\u0430\u043d\u043d\u043e\u0439 \u0441\u0442\u0430\u0442\u044c\u0435 \u0431\u0443\u0434\u0435\u0442 \u0440\u0430\u0441\u0441\u043c\u043e\u0442\u0440\u0435\u043d\u0430 <b>\u0441\u0435\u0442\u044c \u043e\u0431\u043c\u0435\u043d\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u0441\u043e \u0441\u043b\u0438\u044f\u043d\u0438\u0435\u043c \u0411\u044d\u0442\u0447\u0435\u0440\u0430<\/b> \u0434\u043b\u044f \u043f\u0430\u0440\u0430\u043b\u043b\u0435\u043b\u044c\u043d\u043e\u0439 \u0441\u043e\u0440\u0442\u0438\u0440\u043e\u0432\u043a\u0438 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0433\u043e \u0440\u0430\u0437\u043c\u0435\u0440\u0430.<\/p>\n<p>  <img decoding=\"async\" src=\"https:\/\/habrastorage.org\/files\/2e9\/b3a\/459\/2e9b3a45980f421a8a48bf426fa9c6d4.png\"\/><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-274353","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274353","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=274353"}],"version-history":[{"count":0,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=\/wp\/v2\/posts\/274353\/revisions"}],"wp:attachment":[{"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=274353"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=274353"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/savepearlharbor.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=274353"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}