{"id":4886,"date":"2019-02-24T17:29:28","date_gmt":"2019-02-24T14:29:28","guid":{"rendered":"http:\/\/java.mazurok.com\/?p=4886"},"modified":"2019-04-11T00:39:52","modified_gmt":"2019-04-10T21:39:52","slug":"%d0%b0701%d0%b1","status":"publish","type":"post","link":"https:\/\/java.mazurok.com\/?p=4886","title":{"rendered":"\u0410701\u0431"},"content":{"rendered":"<h3>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438<\/h3>\n<p>\u0414\u0430\u043d\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 [latex]A[\/latex] \u043f\u043e\u0440\u044f\u0434\u043a\u0430 [latex]n[\/latex] \u0438 \u0432\u0435\u043a\u0442\u043e\u0440 [latex]b[\/latex] c [latex]n[\/latex] \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \\[A^{2} \\cdot b\\]\n<h3>\u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f<\/h3>\n<p>\u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443. \u0412\u043e\u0437\u0432\u043e\u0434\u0438\u043c \u0435\u0435 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 ( \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0446\u0438\u043a\u043b\u043e\u0432). \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440. \u0423\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430 \u0432\u0435\u043a\u0442\u043e\u0440. \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043e\u0442\u0432\u0435\u0442.<\/p>\n<p>\u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e. \u0421\u0443\u043c\u043c\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432.<\/p>\n<h3>\u0422\u0435\u0441\u0442\u044b<\/h3>\n<table>\n<tbody>\n<tr>\n<td>[latex]n[\/latex]<\/td>\n<td>[latex]A[\/latex]<\/td>\n<td>[latex]b[\/latex]<\/td>\n<td>\u0420\u0435\u0437\u0443\u043b\u044c\u0442\u0430\u0442<\/td>\n<\/tr>\n<tr>\n<td>3<\/td>\n<td>1 1 1<br \/>\n1 1 1<br \/>\n1 1 1<\/td>\n<td>5 5 5<\/td>\n<td>45 45 45<\/td>\n<\/tr>\n<tr>\n<td>5<\/td>\n<td>1 0 0 0 0<br \/>\n0 2 0 0 0<br \/>\n0 0 3 0 0<br \/>\n0 0 0 4 0<br \/>\n0 0 0 0 5<\/td>\n<td> 8 1 8 1 8<\/td>\n<td>8 4 72 16 200<\/td>\n<\/tr>\n<tr>\n<td>2<\/td>\n<td>1 0<br \/>\n0 1<\/td>\n<td>2 2<\/td>\n<td>2 2<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<h4>\u041a\u043e\u0434 \u043f\u0440\u043e\u0433\u0440\u0430\u043c\u043c\u044b<\/h4>\n<pre class=\"lang:java decode:true \">import java.util.*;\r\nimport java.lang.*;\r\nimport java.io.*;\r\n \r\nclass Ideone\r\n{\r\n\tpublic static void main (String[] args) throws java.lang.Exception\r\n\t{\r\n\t\tint n;\r\n\t\tdouble matr1[][];\r\n\t\tdouble matr2[][];\r\n\t\tdouble vet1[];\r\n\t\tdouble vet2[];\r\n\t\tScanner sc = new Scanner(System.in);\r\n\t\tn = sc.nextInt();\r\n\t\tmatr1 = new double[n][n];  \/\/\u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0410 \r\n\t\tmatr2 = new double[n][n]; \/\/ \u041c\u0430\u0442\u0440\u0438\u0446\u0430 \u0410^2\r\n\t\tvet1 = new double[n];  \/\/\u0412\u0435\u043a\u0442\u043e\u0440 \u0434\u0430\u043d\u043d\u044b\u0439 \u043f\u043e \u0443\u0441\u043b\u043e\u0432\u0438\u044e (\u0432\u0435\u043a\u0442\u043e\u0440 b)\r\n\t\tvet2 = new double[n];  \/\/\u041a\u043e\u043d\u0435\u0447\u043d\u044b\u0439 \u0432\u0435\u043a\u0442\u043e\u0440\r\n \r\n\t\tfor(int i = 0;i &lt; n;i++){\r\n\t\t\tfor(int j = 0; j &lt; n; j++) \/\/ \u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0410\r\n\t\t\t\tmatr1[i][j] = sc.nextInt();\r\n\t\t}\r\n \r\n\t\tfor(int i = 0; i &lt; n;i++){\r\n\t\t\tfor(int j = 0;j &lt; n;j++){  \/\/\u0412\u043e\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u0410 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442\r\n\t\t\t\tmatr2[i][j] = 0;\r\n\t\t\t\tfor(int p = 0;p &lt; n;p++)\r\n\t\t\t\t\tmatr2[i][j] += (matr1[i][p]*matr1[p][j]);\r\n\t\t\t}\r\n\t\t}\r\n \r\n\t\tfor(int i = 0; i &lt; n; i++)                \/\/\u0418\u043d\u0438\u0446\u0438\u0430\u043b\u0438\u0437\u0430\u0446\u0438\u044f \u0432\u0435\u043a\u0442\u043e\u0440\u0430\r\n\t\t\tv\r\n\t\t\tet1[i] = sc.nextInt();\r\n \r\n\t\tfor(int i = 0;i &lt; n;i++){\r\n\t\t\tvet2[i] = 0;\r\n\t\t\tfor(int j=0; j&lt;n; j++){\r\n\t\t\t\tvet2[i] += matr2[i][j]*vet1[j]; \/\/\u0423\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043d\u0430 \u0432\u0435\u043a\u0442\u043e\u0440\r\n\t\t\t}\r\n\t\t}\r\n \r\n\t\tfor(int i = 0; i &lt; n; i++)\r\n\t\t\tSystem.out.println(vet2[i]);       \/\/\u0412\u044b\u0432\u043e\u0434 \u0432\u0435\u043a\u0442\u043e\u0440\u0430\r\n \r\n\t\tsc.close();\r\n \r\n\t}\r\n}<\/pre>\n<p>\u041a\u043e\u0434 \u043d\u0430 <a href=\"https:\/\/ideone.com\/2tfEb0\">ideone.com.<\/a><\/p>\n<p>\u0417\u0430\u0434\u0430\u0447\u0430 \u043e\u0440\u0438\u0433\u0438\u043d\u0430\u043b \u043d\u0430 \u044f\u0437\u044b\u043a\u0435 \u0421++(\u0434\u0440\u0443\u0433\u043e\u0433\u043e \u0430\u0432\u0442\u043e\u0440\u0430) \u043d\u0430 <a href=\"http:\/\/cpp.mazurok.com\/a701b\/\"> java.mazurok.com.<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u0423\u0441\u043b\u043e\u0432\u0438\u0435 \u0437\u0430\u0434\u0430\u0447\u0438 \u0414\u0430\u043d\u044b \u043a\u0432\u0430\u0434\u0440\u0430\u0442\u043d\u0430\u044f \u043c\u0430\u0442\u0440\u0438\u0446\u0430 [latex]A[\/latex] \u043f\u043e\u0440\u044f\u0434\u043a\u0430 [latex]n[\/latex] \u0438 \u0432\u0435\u043a\u0442\u043e\u0440 [latex]b[\/latex] c [latex]n[\/latex] \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u0430\u043c\u0438. \u041f\u043e\u043b\u0443\u0447\u0438\u0442\u044c \u0432\u0435\u043a\u0442\u043e\u0440 \\[A^{2} \\cdot b\\] \u0410\u043b\u0433\u043e\u0440\u0438\u0442\u043c \u0440\u0435\u0448\u0435\u043d\u0438\u044f \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443. \u0412\u043e\u0437\u0432\u043e\u0434\u0438\u043c \u0435\u0435 \u0432 \u043a\u0432\u0430\u0434\u0440\u0430\u0442 ( \u043f\u0435\u0440\u0435\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446\u044b \u043e\u0441\u0443\u0449\u0435\u0441\u0442\u0432\u043b\u044f\u0435\u0442\u0441\u044f \u043f\u0440\u0438 \u043f\u043e\u043c\u043e\u0449\u0438 \u0446\u0438\u043a\u043b\u043e\u0432). \u0421\u0447\u0438\u0442\u044b\u0432\u0430\u0435\u043c \u0432\u0435\u043a\u0442\u043e\u0440. \u0423\u043c\u043d\u043e\u0436\u0430\u0435\u043c \u043c\u0430\u0442\u0440\u0438\u0446\u0443 \u043d\u0430 \u0432\u0435\u043a\u0442\u043e\u0440. \u0412\u044b\u0432\u043e\u0434\u0438\u043c \u043e\u0442\u0432\u0435\u0442. \u0424\u0430\u043a\u0442\u0438\u0447\u0435\u0441\u043a\u0438, \u0443\u043c\u043d\u043e\u0436\u0435\u043d\u0438\u0435 \u043c\u0430\u0442\u0440\u0438\u0446 \u043f\u0438\u0448\u0435\u0442\u0441\u044f \u043f\u043e \u043e\u043f\u0440\u0435\u0434\u0435\u043b\u0435\u043d\u0438\u044e. \u0421\u0443\u043c\u043c\u0430 \u043f\u0440\u043e\u0438\u0437\u0432\u0435\u0434\u0435\u043d\u0438\u0439 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u043e\u0432 \u0441\u0442\u0440\u043e\u043a\u0438 \u043d\u0430 \u044d\u043b\u0435\u043c\u0435\u043d\u0442\u044b \u0441\u0442\u043e\u043b\u0431\u0446\u043e\u0432. &hellip; <a href=\"https:\/\/java.mazurok.com\/?p=4886\" class=\"more-link\">Continue reading <span class=\"meta-nav\">&rarr;<\/span><\/a><\/p>\n","protected":false},"author":129,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[25,26],"tags":[41,221,135],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4886"}],"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\/129"}],"replies":[{"embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=4886"}],"version-history":[{"count":5,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4886\/revisions"}],"predecessor-version":[{"id":4909,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=\/wp\/v2\/posts\/4886\/revisions\/4909"}],"wp:attachment":[{"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=4886"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=4886"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/java.mazurok.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=4886"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}