{"id":3595,"date":"2018-09-18T18:30:33","date_gmt":"2018-09-18T15:30:33","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=3595"},"modified":"2018-11-19T21:20:49","modified_gmt":"2018-11-19T18:20:49","slug":"e-olymp-446-%d1%80%d0%be%d0%b2%d0%bd%d1%8b%d0%b5-%d0%b4%d0%b5%d0%bb%d0%b8%d1%82%d0%b5%d0%bb%d0%b8","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=3595","title":{"rendered":"e-olymp 446. \u0420\u043e\u0432\u043d\u044b\u0435 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438"},"content":{"rendered":"<h1>\u0417\u0430\u0434\u0430\u0447\u0430<\/h1>\n<p>\u041d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $m$ \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u044b\u043c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u043c \u0447\u0438\u0441\u043b\u0430 $n$, \u0435\u0441\u043b\u0438 \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u0438 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f $n$ \u043d\u0430 $m$ \u0440\u0430\u0432\u043d\u044b. \u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 $n$ \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0433\u043e \u0440\u043e\u0432\u043d\u044b\u0445 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439.<\/p>\n<h2>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/h2>\n<p>\u041d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $n \\space (1 \u2264 n \u2264 10^{6})$.<\/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 \u0438\u0441\u043a\u043e\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u043e\u0432\u043d\u044b\u0445 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439 \u0447\u0438\u0441\u043b\u0430 $n$.<\/p>\n<h2>\u0422\u0435\u0441\u0442\u044b<\/h2>\n<table>\n<tbody>\n<tr>\n<td>\u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<td>\u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>20<\/td>\n<td>2<\/td>\n<\/tr>\n<tr>\n<td>200<\/td>\n<td>6<\/td>\n<\/tr>\n<tr>\n<td>653<\/td>\n<td>1<\/td>\n<\/tr>\n<tr>\n<td>5982<\/td>\n<td>4<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h2>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h2>\n<pre class=\"lang:java decode:true \" title=\"e-olymp 446. \u0420\u043e\u0432\u043d\u044b\u0435 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0438\">import java.io.*;\r\nimport java.util.*;\r\n \r\npublic class Main\r\n{\r\n\tpublic static void main(String[] args) {\r\n\t\tScanner in = new Scanner(System.in);\r\n\t\tPrintWriter out = new PrintWriter(System.out);\r\n\t\t\r\n\t\tlong n = in.nextLong();\r\n\t\tlong q = 0;\r\n\t\tfor (int m = 1; m &lt;= n; m++)\r\n\t\t\tif (n \/ m == n % m)\r\n\t\t\t\tq += 1;\r\n\t\tout.print(q);\r\n\t\t\r\n\t\tout.flush();\r\n\t}\r\n}<\/pre>\n<h1>\u0420\u0435\u0448\u0435\u043d\u0438\u0435<\/h1>\n<p>\u0414\u043b\u044f \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u044d\u0442\u043e\u0439 \u0437\u0430\u0434\u0430\u0447\u0438 \u0441\u043f\u0435\u0440\u0432\u0430 \u0432\u0432\u0435\u0434\u0435\u043c \u043f\u0435\u0440\u0435\u043c\u0435\u043d\u043d\u0443\u044e  <span class=\"lang:java decode:true  crayon-inline \">q<\/span> , \u0432 \u043a\u043e\u0442\u043e\u0440\u043e\u0439 \u0431\u0443\u0434\u0435\u043c \u0445\u0440\u0430\u043d\u0438\u0442\u044c \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u043e\u0432\u043d\u044b\u0445 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439 \u0447\u0438\u0441\u043b\u0430 $n$. \u0417\u0430\u0442\u0435\u043c \u0437\u0430\u043f\u0443\u0441\u0442\u0438\u043c \u0446\u0438\u043a\u043b, \u043a\u043e\u0442\u043e\u0440\u044b\u0439 \u0431\u0443\u0434\u0435\u0442 \u043f\u0440\u043e\u0432\u0435\u0440\u044f\u0442\u044c \u043a\u0430\u0436\u0434\u043e\u0435 \u0438\u0437 \u0447\u0438\u0441\u0435\u043b \u043e\u0442 $1$ \u0434\u043e $n$ \u0432\u043a\u043b\u044e\u0447\u0438\u0442\u0435\u043b\u044c\u043d\u043e, \u044f\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043b\u0438 \u043e\u043d\u043e \u0440\u043e\u0432\u043d\u044b\u043c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u043c. \u0415\u0441\u043b\u0438 \u0443\u0441\u043b\u043e\u0432\u0438\u0435 \u0432\u044b\u043f\u043e\u043b\u043d\u044f\u0435\u0442\u0441\u044f, \u0442\u043e \u0443\u0432\u0435\u043b\u0438\u0447\u0438\u0432\u0430\u0435\u043c \u0437\u043d\u0430\u0447\u0435\u043d\u0438\u0435, \u0445\u0440\u0430\u043d\u044f\u0449\u0435\u0435\u0441\u044f \u0432  <span class=\"lang:java decode:true  crayon-inline \">q<\/span>  \u043d\u0430 <em>\u0435\u0434\u0438\u043d\u0438\u0446\u0443<\/em>. \u041f\u043e\u0441\u043b\u0435 \u0446\u0438\u043a\u043b\u0430 \u0432\u044b\u0432\u0435\u0434\u0435\u043c \u0438\u0441\u043a\u043e\u043c\u043e\u0435 \u043d\u0430 \u044d\u043a\u0440\u0430\u043d.<\/p>\n<h2>\u0421\u0441\u044b\u043b\u043a\u0438<\/h2>\n<p><a href=\"https:\/\/www.e-olymp.com\/ru\/problems\/446\">\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 e-olymp<\/a><br \/>\n<a href=\"https:\/\/ideone.com\/4goGUZ\">\u041a\u043e\u0434 \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u043d\u0430 Ideone<\/a><br \/>\n<a href=\"http:\/\/cpp.mazurok.com\/e-olymp_446\/\">\u0420\u0435\u0448\u0435\u043d\u0438\u0435 \u044d\u0442\u043e\u0439 \u0436\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u043d\u0430 C++<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u041d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $m$ \u043d\u0430\u0437\u044b\u0432\u0430\u0435\u0442\u0441\u044f \u0440\u043e\u0432\u043d\u044b\u043c \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u043c \u0447\u0438\u0441\u043b\u0430 $n$, \u0435\u0441\u043b\u0438 \u0447\u0430\u0441\u0442\u043d\u043e\u0435 \u0438 \u043e\u0441\u0442\u0430\u0442\u043e\u043a \u043e\u0442 \u0434\u0435\u043b\u0435\u043d\u0438\u044f $n$ \u043d\u0430 $m$ \u0440\u0430\u0432\u043d\u044b. \u041f\u043e \u0437\u0430\u0434\u0430\u043d\u043d\u043e\u043c\u0443 \u043d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u043c\u0443 \u0447\u0438\u0441\u043b\u0443 $n$ \u043d\u0430\u0439\u0442\u0438 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0435\u0433\u043e \u0440\u043e\u0432\u043d\u044b\u0445 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439. \u0412\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u041d\u0430\u0442\u0443\u0440\u0430\u043b\u044c\u043d\u043e\u0435 \u0447\u0438\u0441\u043b\u043e $n \\space (1 \u2264 n \u2264 10^{6})$. \u0412\u044b\u0445\u043e\u0434\u043d\u044b\u0435 \u0434\u0430\u043d\u043d\u044b\u0435 \u0412\u044b\u0432\u0435\u0434\u0438\u0442\u0435 \u0438\u0441\u043a\u043e\u043c\u043e\u0435 \u043a\u043e\u043b\u0438\u0447\u0435\u0441\u0442\u0432\u043e \u0440\u043e\u0432\u043d\u044b\u0445 \u0434\u0435\u043b\u0438\u0442\u0435\u043b\u0435\u0439 \u0447\u0438\u0441\u043b\u0430 $n$. \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 5 &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=3595\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":114,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[362,145],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/3595"}],"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\/114"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=3595"}],"version-history":[{"count":5,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/3595\/revisions"}],"predecessor-version":[{"id":3796,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/3595\/revisions\/3796"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=3595"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=3595"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=3595"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}