{"id":5379,"date":"2020-12-05T22:52:29","date_gmt":"2020-12-05T19:52:29","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=5379"},"modified":"2020-12-07T19:39:27","modified_gmt":"2020-12-07T16:39:27","slug":"e-olymp-1288-n-%d0%b7%d0%bd%d0%b0%d1%87%d0%bd%d1%8b%d0%b5-%d1%87%d0%b8%d1%81%d0%bb%d0%b0","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=5379","title":{"rendered":"e-olymp 1288. n-\u0437\u043d\u0430\u0447\u043d\u044b\u0435 \u0447\u0438\u0441\u043b\u0430"},"content":{"rendered":"<h3>\u0417\u0430\u0434\u0430\u0447\u0430:<\/h3>\n<p>\u0421\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445\u00a0$n$ -\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u0446\u0438\u0444\u0440\u044b $a$ \u0438\u043b\u0438 \u0446\u0438\u0444\u0440\u044b $b$?<\/p>\n<h3>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/h3>\n<p>\u0417\u0430\u0434\u0430\u043d\u044b \u0442\u0440\u0438 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430: \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 $n$ [latex](0 \\lt n \\leqslant 10^6)[\/latex]\u00a0\u0438 \u0446\u0435\u043b\u044b\u0435 $a$ \u0438 $b$. \u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u0430\u043a \u0438 \u0441\u0430\u043c\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0437\u0430\u0434\u0430\u043d\u044b \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f.<\/p>\n<h3>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435:<\/h3>\n<p>\u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 $n$ -\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u0446\u0438\u0444\u0440\u044b $a$ \u0438\u043b\u0438 \u0446\u0438\u0444\u0440\u044b $b$.<\/p>\n<h3>\u0422\u0435\u0441\u0442\u044b:<\/h3>\n<table>\n<tbody>\n<tr>\n<td>\u0412\u0412\u041e\u0414<\/td>\n<td>\u0412\u042b\u0412\u041e\u0414<\/td>\n<\/tr>\n<tr>\n<td width='359'> 3 3 4 <\/td>\n<td width='359'>\u00a0200 <\/td>\n<\/tr>\n<tr>\n<td width='359'>\u00a01 2 2<\/td>\n<td width='359'>\u00a01 <\/td>\n<\/tr>\n<tr>\n<td width='359'>\u00a04 0 0 <\/td>\n<td width='359'>\u00a00 <\/td>\n<\/tr>\n<tr>\n<td width='359'>\u00a010 9 9 <\/td>\n<td width='359'>\u00a01000000000<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h3>\u041a\u043e\u0434 (\u0412\u0430\u0440\u0438\u0430\u043d\u0442 1):<\/h3>\n<pre class=\"lang:Java decode:true\" title=\"n-znachnue 4isla\">\r\nimport java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n\r\nclass Main\r\n{\r\n  public static void main (String[] args)\r\n  {\r\n    Scanner sc = new Scanner(System.in);\r\n        int n = sc.nextInt(); \r\n        int a = sc.nextInt(); \r\n        int b = sc.nextInt(); \r\n        String s = new String();\r\n        if(a + b == 0){\r\n          System.out.print(0);\r\n        } else{\r\n          if((a == b) | (a * b == 0)) System.out.print(1);\r\n        else System.out.print(2);\r\n          for (int i = 0; i &lt; n - 1; i++){\r\n            s += &#039;0&#039;;\r\n        } \r\n     } System.out.print(s);\r\n }\r\n<\/pre>\n<h3>\u041a\u043e\u0434 (\u0412\u0430\u0440\u0438\u0430\u043d\u0442 2):<\/h3>\n<pre class=\"lang:Java decode:true\" title=\"n-znachnue 4isla\">\r\nimport java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n\r\nclass Main\r\n{\r\n  public static void main (String[] args)\r\n  {\r\n    Scanner sc = new Scanner(System.in);\r\n        int n = sc.nextInt(); \r\n        int a = sc.nextInt(); \r\n        int b = sc.nextInt();\r\n        int cond1 = a != b ? 1 : 0;\r\n        int cond2 = a * b &gt; 0 ? 1 : 0;\r\n        String s = new String();\r\n        System.out.print(cond1 + cond2);\r\n        for(int i = 1; i  0; ++i) System.out.print(0);\r\n  }\r\n}\r\n<\/pre>\n<h3>\u0420\u0435\u0448\u0435\u043d\u0438\u0435:<\/h3>\n<p>\u0421\u0440\u0435\u0434\u0438 \u043e\u0434\u043d\u043e\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u043a\u0430\u0436\u0434\u043e\u0439 \u0446\u0438\u0444\u0440\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u043e\u0434\u043d\u043e \u0447\u0438\u0441\u043b\u043e.<br \/>\n\u0421\u0440\u0435\u0434\u0438 \u0434\u0432\u0443\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u0441 \u043e\u0434\u043d\u043e\u0439 \u0446\u0438\u0444\u0440\u044b \u043d\u0430\u0447\u0438\u043d\u0430\u0435\u0442\u0441\u044f \u0443\u0436\u0435 \u0434\u0435\u0441\u044f\u0442\u044c \u0447\u0438\u0441\u0435\u043b.<br \/>\n\u0421\u0440\u0435\u0434\u0438 \u0442\u0440\u0435\u0445\u0437\u043d\u0430\u0447\u043d\u044b\u0445 &#8212; \u0441\u0442\u043e \u0438 \u0442\u0430\u043a \u0434\u0430\u043b\u0435\u0435. \u041b\u0435\u0433\u043a\u043e \u0437\u0430\u043c\u0435\u0442\u0438\u0442\u044c \u0437\u0430\u043a\u043e\u043d\u043e\u043c\u0435\u0440\u043d\u043e\u0441\u0442\u044c, \u0447\u0442\u043e \u0432 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u0435 \u0447\u0438\u0441\u0435\u043b, \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0441 \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u043d\u043e\u0439 \u0446\u0438\u0444\u0440\u044b, \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u0432\u0441\u0435\u0433\u0434\u0430 \u043e\u0441\u0442\u0430\u0435\u0442\u0441\u044f, \u0430 \u043a \u043d\u0435\u0439 \u043f\u0440\u0438\u043f\u0438\u0441\u044b\u0432\u0430\u044e\u0442 $n-1$ \u043d\u0443\u043b\u0435\u0439, \u0433\u0434\u0435 $n$ &#8212; \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u0430\u0437\u0440\u044f\u0434\u043e\u0432.<br \/>\n\u0415\u0441\u043b\u0438 \u043c\u044b \u0438\u0449\u0435\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0447\u0438\u0441\u0435\u043b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0449\u0438\u0445\u0441\u044f \u0443\u0436\u0435 \u0441 \u0434\u0432\u0443\u0445 \u0440\u0430\u0437\u043d\u044b\u0445 \u0446\u0438\u0444\u0440, \u0442\u043e \u0435\u0434\u0438\u043d\u0438\u0446\u0430 \u043c\u0435\u043d\u044f\u0435\u0442\u0441\u044f \u043d\u0430 \u0434\u0432\u043e\u0439\u043a\u0443, \u0430 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0443\u043b\u0435\u0439 \u0441\u043e\u0445\u0440\u0430\u043d\u044f\u0435\u0442\u0441\u044f.<\/p>\n<p>\u041e\u0442\u0441\u044e\u0434\u0430 \u0438 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 &#8212; \u043f\u043e\u0441\u043b\u0435\u0434\u043e\u0432\u0430\u0442\u0435\u043b\u044c\u043d\u0430\u044f \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u0432\u0441\u0435\u0445 \u0432\u0430\u0440\u0438\u0430\u043d\u0442\u043e\u0432 \u0438 \u0432\u044b\u0432\u043e\u0434 \u043e\u0442\u0432\u0435\u0442\u0430.<\/p>\n<p>P.S. \u0414\u0430\u043d\u043d\u043e\u0435 \u0440\u0435\u0448\u0435\u043d\u0438\u0435 \u043d\u0435 \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0442\u0435\u0441\u0442\u044b 12-19 \u043d\u0430 \u0441\u0430\u0439\u0442\u0435 <a class=\"link\" href=\"https:\/\/www.e-olymp.com\/ru\/problems\/1288\">e-olymp.<\/a> \u042d\u0442\u043e \u043f\u0440\u043e\u0438\u0441\u0445\u043e\u0434\u0438\u0442 \u0438\u0437-\u0437\u0430 \u0442\u043e\u0433\u043e, \u0447\u0442\u043e \u0432 \u044d\u0442\u0438\u0445 \u0442\u0435\u0441\u0442\u0430\u0445 \u0440\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442 &#8212; \u044d\u0442\u043e \u0447\u0438\u0441\u043b\u043e \u0441 \u0431\u043e\u043b\u044c\u0448\u0438\u043c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e\u043c \u043d\u0443\u043b\u0435\u0439, \u0430 \u044f\u0437\u044b\u043a Java \u0442\u0440\u0430\u0442\u0438\u0442 \u043c\u043d\u043e\u0433\u043e \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u043d\u0430 \u0438\u0445 \u0432\u044b\u0432\u043e\u0434. \u0422\u043e \u0435\u0441\u0442\u044c, \u0442\u0435\u0441\u0442\u044b \u043d\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u044e\u0442\u0441\u044f \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437-\u0437\u0430 \u0432\u0440\u0435\u043c\u0435\u043d\u0438 \u0440\u0430\u0431\u043e\u0442\u044b. \u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++ \u043f\u0440\u043e\u0445\u043e\u0434\u0438\u0442 \u0431\u0435\u0437 \u043f\u0440\u043e\u0431\u043b\u0435\u043c \u0432\u0441\u0435 \u0442\u0435\u0441\u0442\u044b. <\/p>\n<h3>\u0421\u0441\u044b\u043b\u043a\u0438:<\/h3>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 <a class=\"link\" href=\"https:\/\/www.e-olymp.com\/ru\/problems\/1288\">e-olymp<\/a><br \/>\n\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u21161 <a class=\"link\" href=\"https:\/\/ideone.com\/fork\/uwgPh0\">ideone<\/a><br \/>\n\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u21162 <a class=\"link\" href=\"https:\/\/ideone.com\/fork\/ocxE0U\">ideone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430: \u0421\u043a\u043e\u043b\u044c\u043a\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445\u00a0$n$ -\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u0446\u0438\u0444\u0440\u044b $a$ \u0438\u043b\u0438 \u0446\u0438\u0444\u0440\u044b $b$? \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0417\u0430\u0434\u0430\u043d\u044b \u0442\u0440\u0438 \u0446\u0435\u043b\u044b\u0445 \u0447\u0438\u0441\u043b\u0430: \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 $n$ [latex](0 \\lt n \\leqslant 10^6)[\/latex]\u00a0\u0438 \u0446\u0435\u043b\u044b\u0435 $a$ \u0438 $b$. \u0412\u0441\u0435 \u0434\u0430\u043d\u043d\u044b\u0435, \u043a\u0430\u043a \u0438 \u0441\u0430\u043c\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438, \u0437\u0430\u0434\u0430\u043d\u044b \u0432 \u0434\u0435\u0441\u044f\u0442\u0438\u0447\u043d\u043e\u0439 \u0441\u0438\u0441\u0442\u0435\u043c\u0435 \u0441\u0447\u0438\u0441\u043b\u0435\u043d\u0438\u044f. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435: \u0412\u044b\u0432\u0435\u0441\u0442\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u044b\u0445 $n$ -\u0437\u043d\u0430\u0447\u043d\u044b\u0445 \u0447\u0438\u0441\u0435\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0435 \u043d\u0430\u0447\u0438\u043d\u0430\u044e\u0442\u0441\u044f \u0441 \u0446\u0438\u0444\u0440\u044b $a$ \u0438\u043b\u0438 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=5379\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":180,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[201,203,102],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5379"}],"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\/180"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=5379"}],"version-history":[{"count":10,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5379\/revisions"}],"predecessor-version":[{"id":5415,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/5379\/revisions\/5415"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=5379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=5379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=5379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}