{"id":4180,"date":"2018-12-24T02:01:11","date_gmt":"2018-12-23T23:01:11","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4180"},"modified":"2018-12-25T21:03:18","modified_gmt":"2018-12-25T18:03:18","slug":"e-olymp-2666-%d0%bf%d0%be%d0%bb%d0%be%d0%b2%d0%b8%d0%bd%d0%b0","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4180","title":{"rendered":"e-olymp 2666. \u041f\u043e\u043b\u043e\u0432\u0438\u043d\u0430"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p>\u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0443\u044e \u043c\u0430\u0441\u0441\u0438\u0432 [latex]n \u00d7 n[\/latex] \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043d\u0430 \u043f\u043e\u0431\u043e\u0447\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u0441\u0442\u043e\u044f\u0442 \u043d\u0443\u043b\u0438, \u0432\u044b\u0448\u0435 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u0434\u0432\u043e\u0439\u043a\u0438, \u043d\u0438\u0436\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b.<\/p>\n<p><a href=\"http:\/\/java.mazurok.com\/wp-content\/uploads\/2666.svg\"><img loading=\"lazy\" decoding=\"async\" class=\"size-medium wp-image-4181 aligncenter\" role=\"img\" src=\"http:\/\/java.mazurok.com\/wp-content\/uploads\/2666.svg\" alt=\"\" width=\"300\" height=\"300\" \/><\/a><\/p>\n<h1>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0414\u0430\u043d\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e [latex]n[\/latex] [latex](n \\leqslant 20).[\/latex]\n<h1>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443.<\/p>\n<h1>\u0422\u0435\u0441\u0442\u044b<\/h1>\n<table>\n<tbody>\n<tr>\n<th>#<\/th>\n<th>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<th>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/th>\n<\/tr>\n<tr>\n<td>1<\/td>\n<td>2<\/td>\n<td>20<br \/>\n01<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>3<\/td>\n<td>220<br \/>\n201<br \/>\n011<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>4<\/td>\n<td>2220<br \/>\n2201<br \/>\n2011<br \/>\n0111<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>5<\/td>\n<td>22220<br \/>\n22201<br \/>\n22011<br \/>\n20111<br \/>\n01111<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>10<\/td>\n<td>2222222220<br \/>\n2222222201<br \/>\n2222222011<br \/>\n2222220111<br \/>\n2222201111<br \/>\n2222011111<br \/>\n2220111111<br \/>\n2201111111<br \/>\n2011111111<br \/>\n0111111111<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h1>\n<pre class=\"lang:java decode:true \">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n \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\tScanner in = new Scanner(System.in);\r\n\t\tint n = in.nextInt();\r\n\t\tint[][] arr = new int [20][20];\r\n\t\tfor (int i = 0; i &lt; n; i++){\r\n\t\t\tfor (int j = 0; j &lt; n; j++){\r\n\t\t\t\tif(i + j == n - 1) arr[i][j] = 0;\r\n\t\t\t\telse if (i + j &lt; n - 1) arr[i][j] = 2;\r\n\t\t\t\telse arr[i][j] = 1;\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor (int i = 0; i &lt; n; i++){\r\n\t\t\tfor (int j = 0; j &lt; n; j++){\r\n\t\t\t\tSystem.out.print(arr[i][j]);\r\n\t\t\t}\r\n\t\tSystem.out.println();\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h1>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043e\u0437\u0434\u0430\u0434\u0438\u043c \u0434\u0432\u0443\u043c\u0435\u0440\u043d\u044b\u0439 \u043c\u0430\u0441\u0441\u0438\u0432, \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0441\u0442\u0440\u043e\u043a \u0438 \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0433\u043e \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u044e\u0442 [latex]20.[\/latex] \u0417\u0430\u043f\u043e\u043b\u043d\u044f\u0442\u044c \u0435\u0433\u043e \u0431\u0443\u0434\u0435\u043c \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0434\u0432\u043e\u0439\u043d\u043e\u0433\u043e \u0446\u0438\u043a\u043b\u0430, \u043a\u0430\u043a \u0443\u043a\u0430\u0437\u0430\u043d\u043e \u0432 \u0440\u0435\u0448\u0435\u043d\u0438\u0438 \u0437\u0430\u0434\u0430\u0447\u0438. \u0412\u0432\u0435\u0434\u0435\u043c \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u0435 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f:<\/p>\n<ul>\n<li>[latex]i + j = n &#8212; 1,[\/latex] \u0435\u0441\u043b\u0438 \u044f\u0447\u0435\u0439\u043a\u0430 [latex](i,j)[\/latex] \u043b\u0435\u0436\u0438\u0442 \u043d\u0430 \u043f\u043e\u0431\u043e\u0447\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438;<\/li>\n<li>[latex]i + j &gt; n &#8212; 1,[\/latex] \u0435\u0441\u043b\u0438 \u044f\u0447\u0435\u0439\u043a\u0430 [latex](i,j)[\/latex] \u043b\u0435\u0436\u0438\u0442 \u043d\u0438\u0436\u0435 \u043f\u043e\u0431\u043e\u0447\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438;<\/li>\n<li>[latex]i + j &lt; n &#8212; 1,[\/latex] \u0435\u0441\u043b\u0438 \u044f\u0447\u0435\u0439\u043a\u0430 [latex](i,j)[\/latex] \u043b\u0435\u0436\u0438\u0442 \u0432\u044b\u0448\u0435 \u043f\u043e\u0431\u043e\u0447\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438.<\/li>\n<\/ul>\n<p>\u0414\u0430\u043b\u0435\u0435 \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u0435\u043c \u043c\u0430\u0441\u0441\u0438\u0432 \u0432 \u0441\u043e\u043e\u0442\u0432\u0435\u0442\u0441\u0442\u0432\u0438\u0438 \u0441 \u0432\u0432\u0435\u0434\u0435\u043d\u044b\u043c\u0438 \u043e\u0431\u043e\u0437\u043d\u0430\u0447\u0435\u043d\u0438\u044f\u043c\u0438 \u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435\u043c \u0437\u0430\u0434\u0430\u0447\u0438, \u0430 \u0437\u0430\u0442\u0435\u043c \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u0435\u0433\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d. \u0417\u0430\u0434\u0430\u0447\u0430 \u0440\u0435\u0448\u0435\u043d\u0430.<\/p>\n<h1>\u0421\u0441\u044b\u043b\u043a\u0438<\/h1>\n<p>\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/2666\" target=\"_blank\" rel=\"noopener\">e-olymp<\/a><br \/>\n\u0421\u0441\u044b\u043b\u043a\u0430 \u043d\u0430 <a href=\"https:\/\/ideone.com\/wkil5a\" target=\"_blank\" rel=\"noopener\">ideone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u041d\u0430\u043f\u0438\u0448\u0438\u0442\u0435 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u0443, \u0437\u0430\u043f\u043e\u043b\u043d\u044f\u044e\u0449\u0443\u044e \u043c\u0430\u0441\u0441\u0438\u0432 [latex]n \u00d7 n[\/latex] \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c: \u043d\u0430 \u043f\u043e\u0431\u043e\u0447\u043d\u043e\u0439 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u0441\u0442\u043e\u044f\u0442 \u043d\u0443\u043b\u0438, \u0432\u044b\u0448\u0435 \u0434\u0438\u0430\u0433\u043e\u043d\u0430\u043b\u0438 \u0434\u0432\u043e\u0439\u043a\u0438, \u043d\u0438\u0436\u0435 \u0435\u0434\u0438\u043d\u0438\u0446\u044b. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0414\u0430\u043d\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e [latex]n[\/latex] [latex](n \\leqslant 20).[\/latex] \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043c\u0430\u0441\u0441\u0438\u0432, \u0437\u0430\u043f\u043e\u043b\u043d\u0435\u043d\u043d\u044b\u0439 \u043f\u043e \u0443\u043a\u0430\u0437\u0430\u043d\u043d\u043e\u043c\u0443 \u043f\u0440\u0430\u0432\u0438\u043b\u0443. \u0422\u0435\u0441\u0442\u044b # \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 1 2 20 01 2 3 220 201 011 3 4 2220 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4180\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":123,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,26],"tags":[127,556,444,111,557],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4180"}],"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\/123"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4180"}],"version-history":[{"count":2,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4180\/revisions"}],"predecessor-version":[{"id":4183,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4180\/revisions\/4183"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4180"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4180"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4180"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}