{"id":4653,"date":"2018-12-27T21:56:20","date_gmt":"2018-12-27T18:56:20","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4653"},"modified":"2018-12-27T23:31:24","modified_gmt":"2018-12-27T20:31:24","slug":"e-olymp-2197-%d0%b0%d0%bd%d1%82%d0%b8%d0%bf%d0%b0%d0%bb%d0%b8%d0%bd%d0%b4%d1%80%d0%be%d0%bc","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4653","title":{"rendered":"e-olymp 2197. \u0410\u043d\u0442\u0438\u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p>\u041f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u043e\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u0447\u0438\u0442\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0441 \u043e\u0431\u0435\u0438\u0445 \u0441\u0442\u043e\u0440\u043e\u043d. \u0417\u0430\u0434\u0430\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 [latex]s[\/latex]. \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0435\u0451 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u043e \u0434\u043b\u0438\u043d\u0435 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u043e\u043c.<\/p>\n<h1> \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0412\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 [latex]s[\/latex]. \u041e\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0445 \u0431\u0443\u043a\u0432 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0433\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0430, \u043d\u0435 \u043f\u0443\u0441\u0442\u0430, \u0435\u0451 \u0434\u043b\u0438\u043d\u0430 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 100000 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432.<\/p>\n<h1> \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>\u0412 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0443, \u0435\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 \u043d\u0435\u0441\u043a\u043e\u043b\u044c\u043a\u043e \u2014 \u0432\u044b\u0431\u0435\u0440\u0438\u0442\u0435 \u043b\u0435\u043a\u0441\u0438\u043a\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u0438 \u043c\u0438\u043d\u0438\u043c\u0430\u043b\u044c\u043d\u044b\u0439. \u0415\u0441\u043b\u0438 \u0432\u0441\u0435 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0438 s \u044f\u0432\u043b\u044f\u044e\u0442\u0441\u044f \u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u0430\u043c\u0438, \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0432 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b NO SOLUTION.<\/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>abba<\/td>\n<td>abb<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>aaaaaaa<\/td>\n<td>NO SOLUTION<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>abcghgcba<\/td>\n<td>abcghgcb<\/td>\n<\/tr>\n<tr>\n<td>4<\/td>\n<td>abaaabbb<\/td>\n<td>abaaabbb<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h1>\u041a\u043e\u0434<\/h1>\n<pre class=\"lang:java decode:true \">\r\nimport java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n \r\nclass Main\r\n{\r\n\tpublic static boolean Function(String s)\r\n\t{\r\n\t\tfor (int i = 1; i &lt; s.length(); i++)\r\n\t\t{\r\n\t\t\tif (s.charAt(i) != s.charAt(0)) return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\r\n \r\n\tpublic static boolean palindrom(String s)\r\n\t{\r\n\t\tfor (int i = 0; i &lt; s.length()\/2; i++)\r\n\t\t{\r\n\t\t\tif (s.charAt(i) != s.charAt(s.length() - i - 1)) return false;\r\n\t\t}\r\n\t\treturn true;\r\n\t}\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\tString s = in.nextLine();\r\n\t\tif (Function(s)) System.out.println(&quot;NO SOLUTION&quot;);\r\n\t\telse\r\n\t\t{\r\n\t\t\tif (!palindrom(s)) System.out.println(s);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif (s.charAt(0) &lt; s.charAt(1)) System.out.println(s.substring(0, s.length() - 1));\r\n\t\t\t\telse System.out.println(s.substring(1));\r\n\t\t\t}\r\n\t\t}\r\n\t}\r\n}<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<ul>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0443, \u0441\u043e\u0441\u0442\u043e\u044f\u0449\u0443\u044e \u0438\u0437 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432<\/li>\n<li>\u041f\u0440\u043e\u0432\u0435\u0440\u043a\u0430 \u043d\u0430 \u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c<\/li>\n<li>\u0412\u044b\u0432\u043e\u0434 \u0432 \u043b\u0435\u043a\u0441\u0438\u043a\u043e\u0433\u0440\u0430\u0444\u0438\u0447\u0435\u0441\u043a\u043e\u043c \u043f\u043e\u0440\u044f\u0434\u043a\u0435\n<\/ul>\n<h1>\u0421\u0441\u044b\u043b\u043a\u0438<\/h1>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043d\u0430 <a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/47\">e-olymp<\/a><\/p>\n<p>\u041a\u043e\u0434 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 <a href=\"https:\/\/ideone.com\/pAEs0a\">ideone<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u041f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u043e\u043c \u043d\u0430\u0437\u044b\u0432\u0430\u044e\u0442 \u0441\u0442\u0440\u043e\u043a\u0443, \u0447\u0438\u0442\u0430\u044e\u0449\u0443\u044e\u0441\u044f \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u043e \u0441 \u043e\u0431\u0435\u0438\u0445 \u0441\u0442\u043e\u0440\u043e\u043d. \u0417\u0430\u0434\u0430\u043d\u0430 \u0441\u0442\u0440\u043e\u043a\u0430 [latex]s[\/latex]. \u041d\u0430\u0439\u0434\u0438\u0442\u0435 \u0435\u0451 \u043d\u0430\u0438\u0431\u043e\u043b\u044c\u0448\u0443\u044e \u043f\u043e \u0434\u043b\u0438\u043d\u0435 \u043f\u043e\u0434\u0441\u0442\u0440\u043e\u043a\u0443, \u043d\u0435 \u044f\u0432\u043b\u044f\u044e\u0449\u0443\u044e\u0441\u044f \u043f\u0430\u043b\u0438\u043d\u0434\u0440\u043e\u043c\u043e\u043c. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0441\u043e\u0434\u0435\u0440\u0436\u0438\u0442 \u0441\u0442\u0440\u043e\u043a\u0443 [latex]s[\/latex]. \u041e\u043d\u0430 \u0441\u043e\u0441\u0442\u043e\u0438\u0442 \u0442\u043e\u043b\u044c\u043a\u043e \u0438\u0437 \u0441\u0442\u0440\u043e\u0447\u043d\u044b\u0445 \u0431\u0443\u043a\u0432 \u043b\u0430\u0442\u0438\u043d\u0441\u043a\u043e\u0433\u043e \u0430\u043b\u0444\u0430\u0432\u0438\u0442\u0430, \u043d\u0435 \u043f\u0443\u0441\u0442\u0430, \u0435\u0451 \u0434\u043b\u0438\u043d\u0430 \u043d\u0435 \u043f\u0440\u0435\u0432\u044b\u0448\u0430\u0435\u0442 100000 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412 \u0432\u044b\u0445\u043e\u0434\u043d\u043e\u0439 \u0444\u0430\u0439\u043b \u0432\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u043e\u0442\u0432\u0435\u0442 \u043d\u0430 \u0437\u0430\u0434\u0430\u0447\u0443, \u0435\u0441\u043b\u0438 \u043e\u0442\u0432\u0435\u0442\u043e\u0432 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4653\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":111,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[105],"tags":[664,666,665],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4653"}],"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\/111"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4653"}],"version-history":[{"count":1,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4653\/revisions"}],"predecessor-version":[{"id":4728,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4653\/revisions\/4728"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4653"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4653"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4653"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}