{"id":3313,"date":"2017-11-28T22:28:32","date_gmt":"2017-11-28T19:28:32","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=3313"},"modified":"2017-12-06T00:37:34","modified_gmt":"2017-12-05T21:37:34","slug":"%d1%88%d0%b8%d1%84%d1%80%d0%be%d0%b2%d0%ba%d0%b0","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=3313","title":{"rendered":"\u0428\u0438\u0444\u0440\u043e\u0432\u043a\u0430"},"content":{"rendered":"<h1>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h1>\n<p><a href=\"http:\/\/acm.timus.ru\/problem.aspx?space=1&amp;num=1654\">\u0412\u0437\u044f\u0442\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430.<\/a><br \/>\n\u041c\u044e\u043b\u043b\u0435\u0440 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0428\u0442\u0438\u0440\u043b\u0438\u0446\u0430 \u0441 \u043f\u043e\u043b\u0438\u0447\u043d\u044b\u043c, \u043d\u043e \u0442\u043e\u0442 \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043b\u0441\u044f. \u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437 \u0428\u0442\u0438\u0440\u043b\u0438\u0446 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0443\u044e \u043f\u043e\u0447\u0442\u0443. \u0412 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u043e\u0448\u0435\u043b \u041c\u044e\u043b\u043b\u0435\u0440 \u0438 \u0443\u0432\u0438\u0434\u0435\u043b, \u043a\u0430\u043a \u0443 \u043d\u0435\u0433\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u00ab\u0428\u0438\u0444\u0440\u043e\u0432\u043a\u0430\u00bb, \u2014 \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u041c\u044e\u043b\u043b\u0435\u0440. \u00abUTF-8\u00bb, \u2014 \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u0428\u0442\u0438\u0440\u043b\u0438\u0446.<br \/>\n\u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0428\u0442\u0438\u0440\u043b\u0438\u0446 \u0448\u0438\u0444\u0440\u0443\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c \u043e\u0431\u0440\u0430\u0437\u043e\u043c:<\/p>\n<p>     1)\u0423\u0431\u0438\u0440\u0430\u0435\u0442 \u0432\u0441\u0435 \u043f\u0440\u043e\u0431\u0435\u043b\u044b \u0438 \u0437\u043d\u0430\u043a\u0438 \u043f\u0440\u0435\u043f\u0438\u043d\u0430\u043d\u0438\u044f.<br \/>\n     2)\u0417\u0430\u043c\u0435\u043d\u044f\u0435\u0442 \u0432\u0441\u0435 \u043f\u043e\u0434\u0440\u044f\u0434 \u0438\u0434\u0443\u0449\u0438\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0435 \u0431\u0443\u043a\u0432\u044b \u043d\u0430 \u043e\u0434\u043d\u0443 \u0442\u0430\u043a\u0443\u044e \u0431\u0443\u043a\u0432\u0443.<br \/>\n     3)\u041c\u043d\u043e\u0433\u043e\u043a\u0440\u0430\u0442\u043d\u043e \u0432\u0441\u0442\u0430\u0432\u043b\u044f\u0435\u0442 \u0432 \u043f\u0440\u043e\u0438\u0437\u0432\u043e\u043b\u044c\u043d\u043e\u0435 \u043c\u0435\u0441\u0442\u043e \u0442\u0435\u043a\u0441\u0442\u0430 \u0434\u0432\u0435 \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0431\u0443\u043a\u0432\u044b.<\/p>\n<p>\u041f\u043e\u043f\u0440\u043e\u0431\u0443\u0439\u0442\u0435 \u0432\u043e\u0441\u0441\u0442\u0430\u043d\u043e\u0432\u0438\u0442\u044c \u0442\u0435\u043a\u0441\u0442, \u043a\u0430\u043a\u0438\u043c \u043e\u043d \u0431\u044b\u043b \u043f\u043e\u0441\u043b\u0435 \u0432\u0442\u043e\u0440\u043e\u0433\u043e \u0448\u0430\u0433\u0430. \u0414\u043b\u044f \u044d\u0442\u043e\u0433\u043e \u0443\u0434\u0430\u043b\u0438\u0442\u0435 \u0438\u0437 \u0442\u0435\u043a\u0441\u0442\u0430 \u0432\u0441\u0435 \u043f\u0430\u0440\u044b \u043e\u0434\u0438\u043d\u0430\u043a\u043e\u0432\u044b\u0445 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432, \u0434\u043e\u0431\u0430\u0432\u043b\u0435\u043d\u043d\u044b\u0435 \u043d\u0430 \u0442\u0440\u0435\u0442\u044c\u0435\u043c \u0448\u0430\u0433\u0435.<\/p>\n<h1>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>aaxxHuuuuelllnnloxxvvoo!<\/p>\n<h1>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h1>\n<p>Hello!<\/p>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u043a\u043b\u0430\u0441\u0441\u0430 String<\/h1>\n<pre class=\"lang:java decode:true  \">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n\r\n\/* Name of the class has to be \"Main\" only if the class is public. *\/\r\nclass Ideone\r\n{\r\n\tpublic static void main (String[] args) throws java.lang.Exception\r\n\t{\r\n\t\tArrayList arr = new ArrayList();\r\n\t\tString str,str2;\r\n\t\tString empty = \"\";\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tstr = input.nextLine();\r\n\t\tfor(int i = 0;i &lt; str.length(); i++)\r\n\t\t{\r\n\t\t\tstr2 = empty;\r\n\t\t\tstr2 += str.charAt(i);\r\n\t\t\tif(i == str.length()-1)\r\n\t\t\t\tarr.add(str2);\r\n\t\t\telse\r\n\t\t\t{\r\n\t\t\t\tif(str.charAt(i) == str.charAt(i+1))\r\n\t\t\t\t\ti++;\r\n\t\t\t\telse arr.add(str2);\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0;i &lt; arr.size();i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(arr.get(i));\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u0441 \u0438\u0441\u043f\u043e\u043b\u044c\u0437\u043e\u0432\u0430\u043d\u0438\u0435\u043c \u0444\u0443\u043d\u043a\u0446\u0438\u043e\u043d\u0430\u043b\u0430 \u0441\u0442\u0440\u0443\u043a\u0442\u0443\u0440\u044b \u0434\u0430\u043d\u043d\u044b\u0445 ArrayList<\/h1>\n<pre class=\"lang:java decode:true  \">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n\r\n\/* Name of the class has to be \"Main\" only if the class is public. *\/\r\nclass Ideone\r\n{\r\n\tpublic static void main (String[] args) throws java.lang.Exception\r\n\t{\r\n\t\tArrayList arr = new ArrayList();\r\n\t\tScanner input = new Scanner(System.in);\r\n\t\tString str,str2;\r\n\t\tString empty = \"\";\r\n\t\tstr = input.nextLine();\r\n\t\tfor(int i = 0;i&lt;str.length();i++)\r\n\t\t{\r\n\t\t\tstr2 = empty;\r\n\t\t\tstr2 += str.charAt(i);\r\n\t\t\tarr.add(str2);\r\n\t\t}\r\n\t\tfor(int i = 0;i &lt; arr.size(); i++)\r\n\t\t{\r\n\t\t\tif(i != arr.size()-1)\r\n\t\t\t{\r\n\t\t\t\tif(arr.get(i).equals(arr.get(i+1)))\r\n\t\t\t\t{\r\n\t\t\t\t\tarr.remove(i);\r\n\t\t\t\t\tarr.remove(i);\r\n\t\t\t\t\ti--;\r\n\t\t\t\t}\r\n\t\t\t}\r\n\t\t}\r\n\t\tfor(int i = 0;i &lt; arr.size();i++)\r\n\t\t{\r\n\t\t\tSystem.out.print(arr.get(i));\r\n\t\t}\r\n\t}\r\n}\r\n<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<p>\u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0441\u0442\u0440\u043e\u043a\u0443 \u0432 \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e \u0442\u0438\u043f\u0430 $latex String$. \u0417\u0430\u043f\u0438\u0441\u044b\u0432\u0430\u0435\u043c \u0435\u0435 \u0432 $latex ArrayList$ \u043f\u043e\u0441\u0438\u043c\u0432\u043e\u043b\u044c\u043d\u043e. \u0412 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c \u0446\u0438\u043a\u043b\u0435 \u0434\u043e\u0431\u0430\u0432\u043b\u044f\u0435\u043c \u043f\u0440\u043e\u0432\u0435\u0440\u043a\u0443 \u043d\u0430 \u0438\u043d\u0434\u0435\u043a\u0441 \u0442\u0435\u043a\u0443\u0449\u0435\u0433\u043e \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430 \u0447\u0442\u043e\u0431\u044b \u043d\u0435 \u0432\u044b\u0439\u0442\u0438 \u0437\u0430 \u043f\u0440\u0435\u0434\u0435\u043b\u044b \u0441\u043f\u0438\u0441\u043a\u0430 \u0438 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0435\u043c \u0441\u043e\u0432\u043f\u0430\u0434\u0430\u044e\u0442 \u043b\u0438 \u0431\u043b\u0438\u0436\u0430\u0439\u0448\u0438\u0435 2 \u0441\u0438\u043c\u0432\u043e\u043b\u0430, \u0435\u0441\u043b\u0438 \u0434\u0430 \u0442\u043e \u0443\u0434\u0430\u043b\u044f\u0435\u043c \u0438\u0445, \u0435\u0441\u043b\u0438 \u043d\u0435\u0442 \u0442\u043e \u043f\u0435\u0440\u0435\u0445\u043e\u0434\u0438\u043c \u043a \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0435\u043c\u0443 \u0448\u0430\u0433\u0443 \u0446\u0438\u043a\u043b\u0430. \u041f\u043e \u0435\u0433\u043e \u043e\u043a\u043e\u043d\u0447\u0430\u043d\u0438\u044e \u0432\u044b\u0432\u043e\u0434\u0438\u043c \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u043f\u0438\u0441\u043a\u0430.<br \/>\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441\u043e \u0441\u0442\u0440\u043e\u043a\u0430\u043c\u0438 \u043d\u0430 <a href=\"https:\/\/ideone.com\/HhTsKe\">ideone<\/a>.<br \/>\n\u041f\u0440\u0438\u043c\u0435\u0440 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0441 \u0441\u043f\u0438\u0441\u043a\u043e\u043c \u043d\u0430 <a href=\"https:\/\/ideone.com\/MzGAIY\">ideone<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0412\u0437\u044f\u0442\u0430 \u0441 \u0441\u0430\u0439\u0442\u0430. \u041c\u044e\u043b\u043b\u0435\u0440 \u043c\u043d\u043e\u0433\u043e \u0440\u0430\u0437 \u043f\u044b\u0442\u0430\u043b\u0441\u044f \u043f\u043e\u0439\u043c\u0430\u0442\u044c \u0428\u0442\u0438\u0440\u043b\u0438\u0446\u0430 \u0441 \u043f\u043e\u043b\u0438\u0447\u043d\u044b\u043c, \u043d\u043e \u0442\u043e\u0442 \u0432\u0441\u0451 \u0432\u0440\u0435\u043c\u044f \u0432\u044b\u043a\u0440\u0443\u0447\u0438\u0432\u0430\u043b\u0441\u044f. \u041a\u0430\u043a-\u0442\u043e \u0440\u0430\u0437 \u0428\u0442\u0438\u0440\u043b\u0438\u0446 \u043f\u0440\u043e\u0441\u043c\u0430\u0442\u0440\u0438\u0432\u0430\u043b \u044d\u043b\u0435\u043a\u0442\u0440\u043e\u043d\u043d\u0443\u044e \u043f\u043e\u0447\u0442\u0443. \u0412 \u044d\u0442\u043e \u0432\u0440\u0435\u043c\u044f \u043d\u0435\u0437\u0430\u043c\u0435\u0442\u043d\u043e \u0432\u043e\u0448\u0435\u043b \u041c\u044e\u043b\u043b\u0435\u0440 \u0438 \u0443\u0432\u0438\u0434\u0435\u043b, \u043a\u0430\u043a \u0443 \u043d\u0435\u0433\u043e \u043d\u0430 \u044d\u043a\u0440\u0430\u043d\u0435 \u043f\u043e\u044f\u0432\u0438\u043b\u0441\u044f \u0431\u0435\u0441\u0441\u043c\u044b\u0441\u043b\u0435\u043d\u043d\u044b\u0439 \u043d\u0430\u0431\u043e\u0440 \u0441\u0438\u043c\u0432\u043e\u043b\u043e\u0432. \u00ab\u0428\u0438\u0444\u0440\u043e\u0432\u043a\u0430\u00bb, \u2014 \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u041c\u044e\u043b\u043b\u0435\u0440. \u00abUTF-8\u00bb, \u2014 \u043f\u043e\u0434\u0443\u043c\u0430\u043b \u0428\u0442\u0438\u0440\u043b\u0438\u0446. \u0418\u0437\u0432\u0435\u0441\u0442\u043d\u043e, \u0447\u0442\u043e \u0428\u0442\u0438\u0440\u043b\u0438\u0446 \u0448\u0438\u0444\u0440\u0443\u0435\u0442 \u0442\u0435\u043a\u0441\u0442 \u0441\u043b\u0435\u0434\u0443\u044e\u0449\u0438\u043c &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=3313\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":104,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[49],"tags":[41,189,111,325,151,176,75],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/3313"}],"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\/104"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3313"}],"version-history":[{"count":8,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/3313\/revisions"}],"predecessor-version":[{"id":3336,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/3313\/revisions\/3336"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3313"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3313"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3313"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}