{"id":4074,"date":"2018-12-09T23:57:40","date_gmt":"2018-12-09T20:57:40","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4074"},"modified":"2018-12-27T23:27:06","modified_gmt":"2018-12-27T20:27:06","slug":"e-olymp-2669-%d0%bf%d0%be%d0%b2%d0%be%d1%80%d0%be%d1%82","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4074","title":{"rendered":"e-olymp 2669. \u041f\u043e\u0432\u043e\u0440\u043e\u0442"},"content":{"rendered":"<h1>\u041f\u043e\u0432\u043e\u0440\u043e\u0442<\/h1>\n<p>\u0414\u0430\u043d \u043c\u0430\u0441\u0441\u0438\u0432 [latex]n\\times m[\/latex]. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435 \u043d\u0430 [latex]90[\/latex] \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432.<\/p>\n<h2>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0412 \u043f\u0435\u0440\u0432\u043e\u0439 \u0441\u0442\u0440\u043e\u043a\u0435 \u0434\u0430\u043d\u044b \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 [latex]n[\/latex] \u0438 [latex]m[\/latex] [latex](1 \u2264 n, m \u2264 50)[\/latex]. \u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 [latex]n[\/latex] \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u043e [latex]m[\/latex] \u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0438\u0445 [latex]109[\/latex] \u2014 \u0441\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432.<\/p>\n<h2>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445.<\/p>\n<h2>\u0422\u0435\u0441\u0442\u044b<\/h2>\n<table style=\"height: 169px\" width=\"453\">\n<tbody>\n<tr>\n<th>#<\/th>\n<th>\u0412\u0425\u041e\u0414\u041d\u042b\u0415 \u0414\u0410\u041d\u041d\u042b\u0415<\/th>\n<th>\u0412\u042b\u0425\u041e\u0414\u041d\u042b\u0415 \u0414\u0410\u041d\u041d\u042b\u0415<\/th>\n<\/tr>\n<tr>\n<th>1<\/th>\n<th>2 2<\/p>\n<p>1 2<\/p>\n<p>3 4<\/th>\n<th>2 2<\/p>\n<p>3 1<\/p>\n<p>4 2<\/th>\n<\/tr>\n<tr>\n<th>2<\/th>\n<th>3 3<\/p>\n<p>1 2 3<\/p>\n<p>4 5 6<\/p>\n<p>7 8 9<\/th>\n<th>3 3<\/p>\n<p>4 7 1<\/p>\n<p>8 5 2<\/p>\n<p>9 6 3<\/th>\n<\/tr>\n<tr>\n<th>3<\/th>\n<th>3 4<\/p>\n<p>4 5 7 8<\/p>\n<p>3 6 8 7<\/p>\n<p>2 2 4 5<\/th>\n<th>4 3<\/p>\n<p>2 3 4<\/p>\n<p>2 6 5<\/p>\n<p>4 8 7<\/p>\n<p>5 7 8<\/th>\n<\/tr>\n<tr>\n<th>4<\/th>\n<th>1 2<\/p>\n<p>5 4<\/th>\n<th>2 1<\/p>\n<p>5<\/p>\n<p>4<\/th>\n<\/tr>\n<tr>\n<th>5<\/th>\n<th>1 1<\/p>\n<p>2<\/th>\n<th>1 1<\/p>\n<p>2<\/th>\n<\/tr>\n<\/tbody>\n<\/table>\n<p>&nbsp;<\/p>\n<pre class=\"lang:java decode:true\">import java.util.*;\r\nimport java.lang.*;\r\n\r\nclass Main\r\n{\r\n    public static void main (String[] args)\r\n    {\r\n        Scanner input = new Scanner(System.in);\r\n        int n = input.nextInt();\r\n        int m = input.nextInt();\r\n        int x[][] = new int[n][];\r\n        for (int i = 0; i &lt; n; i++)\r\n            x[i] = new int[m];\r\n        for (int i = 0; i &lt; n; i++)\r\n            for (int j = 0; j &lt; m; j++)\r\n                x[i][j] = input.nextInt();\r\n        System.out.println(m + \" \" + n);\r\n        for (int j = 0; j &lt; m; j++){\r\n            for (int i = n - 1; i &gt;= 0; i--)\r\n                System.out.print(x[i][j] + \" \");\r\n            System.out.println();\r\n        }   \r\n    }\r\n}<\/pre>\n<h2>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438:<\/h2>\n<p>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0434\u0430\u043d\u043d\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0432 \u0442\u043e\u043c, \u0447\u0442\u043e\u0431 \u043f\u0440\u0438 \u0432\u044b\u0432\u043e\u0434\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b, \u043d\u0430\u0447\u0430\u0442\u044c \u0432\u044b\u0432\u043e\u0434\u0438\u0442\u044c \u0435\u0435 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u043d\u0435 \u043f\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c, \u0430 \u043f\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430\u043c, \u0441\u043d\u0438\u0437\u0443 \u0432\u0432\u0435\u0440\u0445, \u043d\u0430\u0447\u0438\u043d\u0430\u044f \u0441 \u043f\u0435\u0440\u0432\u043e\u0433\u043e \u0441\u0442\u043e\u043b\u0431\u0446\u0430 (\u043b\u0435\u0432\u043e\u0433\u043e \u043d\u0438\u0436\u043d\u0435\u0433\u043e \u0443\u0433\u043b\u0430 \u043c\u0430\u0442\u0440\u0438\u0446\u044b).<\/p>\n<ul>\n<li>\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/2669\" target=\"_blank\" rel=\"noopener\">e-olymp<\/a><\/li>\n<li>\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0432 <a href=\"https:\/\/ideone.com\/N3r2xH\" target=\"_blank\" rel=\"noopener\">Ideone <\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u041f\u043e\u0432\u043e\u0440\u043e\u0442 \u0414\u0430\u043d \u043c\u0430\u0441\u0441\u0438\u0432 [latex]n\\times m[\/latex]. \u0422\u0440\u0435\u0431\u0443\u0435\u0442\u0441\u044f \u043f\u043e\u0432\u0435\u0440\u043d\u0443\u0442\u044c \u0435\u0433\u043e \u043f\u043e \u0447\u0430\u0441\u043e\u0432\u043e\u0439 \u0441\u0442\u0440\u0435\u043b\u043a\u0435 \u043d\u0430 [latex]90[\/latex] \u0433\u0440\u0430\u0434\u0443\u0441\u043e\u0432. \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 \u0434\u0430\u043d\u044b \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430 [latex]n[\/latex] \u0438 [latex]m[\/latex] [latex](1 \u2264 n, m \u2264 50)[\/latex]. \u041d\u0430 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0445 [latex]n[\/latex] \u0441\u0442\u0440\u043e\u043a\u0430\u0445 \u0437\u0430\u043f\u0438\u0441\u0430\u043d\u043e \u043f\u043e [latex]m[\/latex] \u043d\u0435\u043e\u0442\u0440\u0438\u0446\u0430\u0442\u0435\u043b\u044c\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0449\u0438\u0445 [latex]109[\/latex] \u2014 \u0441\u0430\u043c \u043c\u0430\u0441\u0441\u0438\u0432. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043f\u0435\u0440\u0435\u0432\u0435\u0440\u043d\u0443\u0442\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0444\u043e\u0440\u043c\u0430\u0442\u0435 \u0432\u0445\u043e\u0434\u043d\u044b\u0445 \u0434\u0430\u043d\u043d\u044b\u0445. &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4074\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":133,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,26],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4074"}],"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\/133"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4074"}],"version-history":[{"count":3,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4074\/revisions"}],"predecessor-version":[{"id":4449,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4074\/revisions\/4449"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4074"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4074"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4074"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}