{"id":4531,"date":"2018-12-27T09:20:55","date_gmt":"2018-12-27T06:20:55","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4531"},"modified":"2018-12-27T18:15:56","modified_gmt":"2018-12-27T15:15:56","slug":"e-olymp-922-%d1%81%d0%b4%d0%b2%d0%b8%d0%bd%d1%8c-%d1%8d%d0%bb%d0%b5%d0%bc%d0%b5%d0%bd%d1%82%d1%8b","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4531","title":{"rendered":"e-olymp 922. \u0421\u0434\u0432\u0438\u043d\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b"},"content":{"rendered":"<p><strong>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong><br \/>\n\u0417\u0430\u0434\u0430\u043d \u043c\u0430\u0441\u0441\u0438\u0432 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u044b $n$. \u0421\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u043f\u0440\u0430\u0432\u043e \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 $1$ \u0448\u0430\u0433.<br \/>\n<strong>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 <\/strong><br \/>\n\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 $n$$(n \u2264 100)$ . \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u044b \u0441\u0430\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 $100$.<br \/>\n<strong>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 <\/strong><br \/>\n\u0412 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 $n$ \u0447\u0438\u0441\u0435\u043b \u2014 \u043d\u043e\u0432\u044b\u0435 \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<br \/>\n<strong>\u0422\u0435\u0441\u0442\u044b <\/strong><\/p>\n<table style=\"width: 297px\">\n<tbody>\n<tr>\n<th style=\"width: 142px\">\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<th style=\"width: 155px\">\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<\/tr>\n<tr>\n<td style=\"width: 142px\">\n<h5>4<br \/>\n1 2 3 4 5<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>4 1 2 3<\/h5>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 142px\">\n<h5>6<br \/>\n3 3 3 3 3 1<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>1 3 3 3 3 3<\/h5>\n<\/td>\n<\/tr>\n<tr>\n<td style=\"width: 142px\">\n<h5>2<br \/>\n1 2<\/h5>\n<\/td>\n<td style=\"width: 155px\">\n<h5>2 1<\/h5>\n<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<p><strong>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/strong><\/p>\n<pre class=\"lang:java decode:true \" title=\"e-olymp 922. Slide the elements\">import java.io.BufferedReader;\r\nimport java.io.InputStreamReader;\r\n \r\nclass Main\r\n{\r\n\tpublic static void main (String[] args) throws java.lang.Exception\r\n\t{\r\n\t\tBufferedReader bufferedReader = new BufferedReader(new InputStreamReader(System.in));\r\n        String[] params1 = bufferedReader.readLine().split(\" \");\r\n        int number;\r\n        number = Integer.parseInt(params1[0]);\r\n        int arr[] = new int[number];\r\n        String[] params2 = bufferedReader.readLine().split(\" \");\r\n        for (int i = 0; i &lt; number; i++)\r\n        {\r\n            arr[i] = Integer.parseInt(params2[i]);\r\n        }\r\n        int last = arr[number - 1];\r\n        for (int i = number - 1; i &gt; 0; i--)\r\n        {\r\n            arr[i] = arr[i - 1];\r\n        }\r\n        arr[0] = last;\r\n        for (int i = 0; i &lt; number; i++)\r\n        {\r\n            System.out.print(arr[i]);\r\n            System.out.print(' ');\r\n        }\r\n\t}\r\n}<\/pre>\n<p><strong>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/strong><br \/>\n\u0421\u043e\u0437\u0434\u0430\u0435\u043c \u0434\u0438\u043d\u0430\u043c\u0438\u0447\u0435\u0441\u043a\u0438\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u0440\u0430\u0437\u043c\u0435\u0440\u043e\u043c \u0432 <code>number<\/code> \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432. \u0421\u043e\u0437\u0434\u0430\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e <code>last<\/code>, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0437\u0430\u043f\u0438\u0441\u0430\u043d \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430. \u0421\u043e\u0437\u0434\u0430\u0451\u043c \u0446\u0438\u043a\u043b, \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u043c \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043a\u0430\u0436\u0434\u044b\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0441 \u043f\u0440\u0435\u0434\u044b\u0434\u0443\u0449\u0438\u043c. \u041a\u043b\u0430\u0434\u0435\u043c \u043d\u0430 $1$ \u043c\u0435\u0441\u0442\u043e (\u0442\u043e\u0447\u043d\u0435\u0435 $0$ \u043c\u0435\u0441\u0442\u043e) \u0431\u044b\u0432\u0448\u0438\u0439 \u043f\u043e\u0441\u043b\u0435\u0434\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442 \u043c\u0430\u0441\u0441\u0438\u0432\u0430.<br \/>\n\u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043c\u0430\u0441\u0441\u0438\u0432.<br \/>\n<strong>\u0421\u0441\u044b\u043b\u043a\u0438<\/strong><br \/>\n\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/922\">e-olymp<\/a><br \/>\n\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 <a href=\"https:\/\/ideone.com\/6EEd9F\">Ideone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0417\u0430\u0434\u0430\u043d \u043c\u0430\u0441\u0441\u0438\u0432 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0434\u043b\u0438\u043d\u044b $n$. \u0421\u0434\u0432\u0438\u043d\u0443\u0442\u044c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430 \u0432\u043f\u0440\u0430\u0432\u043e \u0446\u0438\u043a\u043b\u0438\u0447\u0435\u0441\u043a\u0438 \u043d\u0430 $1$ \u0448\u0430\u0433. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u043e \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u043c\u0430\u0441\u0441\u0438\u0432\u0430 $n$$(n \u2264 100)$ . \u0412\u043e \u0432\u0442\u043e\u0440\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0437\u0430\u0434\u0430\u043d\u044b \u0441\u0430\u043c\u0438 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043c\u0430\u0441\u0441\u0438\u0432\u0430, \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435 \u043a\u0430\u0436\u0434\u043e\u0433\u043e \u0438\u0437 \u043a\u043e\u0442\u043e\u0440\u044b\u0445 \u043f\u043e \u043c\u043e\u0434\u0443\u043b\u044e \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 $100$. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412 \u043e\u0434\u043d\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0432\u044b\u0432\u0435\u0441\u0442\u0438 $n$ \u0447\u0438\u0441\u0435\u043b \u2014 \u043d\u043e\u0432\u044b\u0435 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4531\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":112,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25],"tags":[135,623,231,397],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4531"}],"collection":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/users\/112"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4531"}],"version-history":[{"count":4,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4531\/revisions"}],"predecessor-version":[{"id":4559,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4531\/revisions\/4559"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4531"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4531"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4531"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}