{"id":1222,"date":"2022-05-30T10:07:51","date_gmt":"2022-05-30T02:07:51","guid":{"rendered":"https:\/\/sanlangcode.com\/?p=1222"},"modified":"2022-05-30T10:07:51","modified_gmt":"2022-05-30T02:07:51","slug":"hj69%e7%9f%a9%e9%98%b5%e6%95%b0%e4%b9%98%e8%bf%90%e7%ae%97","status":"publish","type":"post","link":"https:\/\/sanlangcode.com\/index.php\/2022\/05\/30\/hj69%e7%9f%a9%e9%98%b5%e6%95%b0%e4%b9%98%e8%bf%90%e7%ae%97\/","title":{"rendered":"HJ69\u77e9\u9635\u6570\u4e58\u8fd0\u7b97"},"content":{"rendered":"\n<h3 class=\"wp-block-heading\">\u8f93\u5165\u63cf\u8ff0\uff1a<\/h3>\n\n\n\n<p>\u7b2c\u4e00\u884c\u5305\u542b\u4e00\u4e2a\u6b63\u6574\u6570x\uff0c\u4ee3\u8868\u7b2c\u4e00\u4e2a\u77e9\u9635\u7684\u884c\u6570<br>\u7b2c\u4e8c\u884c\u5305\u542b\u4e00\u4e2a\u6b63\u6574\u6570y\uff0c\u4ee3\u8868\u7b2c\u4e00\u4e2a\u77e9\u9635\u7684\u5217\u6570\u548c\u7b2c\u4e8c\u4e2a\u77e9\u9635\u7684\u884c\u6570<br>\u7b2c\u4e09\u884c\u5305\u542b\u4e00\u4e2a\u6b63\u6574\u6570z\uff0c\u4ee3\u8868\u7b2c\u4e8c\u4e2a\u77e9\u9635\u7684\u5217\u6570<br>\u4e4b\u540ex\u884c\uff0c\u6bcf\u884cy\u4e2a\u6574\u6570\uff0c\u4ee3\u8868\u7b2c\u4e00\u4e2a\u77e9\u9635\u7684\u503c<br>\u4e4b\u540ey\u884c\uff0c\u6bcf\u884cz\u4e2a\u6574\u6570\uff0c\u4ee3\u8868\u7b2c\u4e8c\u4e2a\u77e9\u9635\u7684\u503c<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u8f93\u51fa\u63cf\u8ff0\uff1a<\/h3>\n\n\n\n<p>\u5bf9\u4e8e\u6bcf\u7ec4\u8f93\u5165\u6570\u636e\uff0c\u8f93\u51fax\u884c\uff0c\u6bcf\u884cz\u4e2a\u6574\u6570\uff0c\u4ee3\u8868\u4e24\u4e2a\u77e9\u9635\u76f8\u4e58\u7684\u7ed3\u679c<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u793a\u4f8b1<\/h2>\n\n\n\n<p>\u8f93\u5165\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">2\n3\n2\n1 2 3\n3 2 1\n1 2\n2 1\n3 3<\/pre>\n\n\n\n<p>\u8f93\u51fa\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">14 13\n10 11<\/pre>\n\n\n\n<p>\u8bf4\u660e\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-preformatted\">1 2 3\n3 2 1 \n\u4e58\u4ee5\n1 2\n2 1\n3 3\n\u7b49\u4e8e\n14 13\n10 11<\/pre>\n\n\n\n<pre class=\"wp-block-code\"><code>import java.util.*;\npublic class Main {\n    public Main() {\n    }\n    public int&#91;]&#91;] mul(int&#91;]&#91;] mat1, int &#91;]&#91;]mat2) {\n        int x = mat1.length, y = mat2.length, z = mat2&#91;0].length;\n        int&#91;]&#91;] res = new int&#91;x]&#91;z];\n        for (int i = 0; i &lt; x; i++) {\n            for (int j = 0; j &lt; z; j++) {\n                for (int k = 0; k &lt; y; k++) {\n                    res&#91;i]&#91;j] += mat1&#91;i]&#91;k] * mat2&#91;k]&#91;j];\n                }\n            }\n        }\n        return res;\n    }\n    public static void main(String&#91;] args) {\n        Main solution = new Main();\n        Scanner in = new Scanner(System.in);\n        while (in.hasNextInt()) {\n            int x = in.nextInt(), y = in.nextInt(), z = in.nextInt();\n            int&#91;]&#91;] mat1 = new int&#91;x]&#91;y];\n            int&#91;]&#91;] mat2 = new int&#91;y]&#91;z];\n            for (int i = 0; i &lt; x; i++) {\n                for (int j = 0; j &lt; y; j++) {\n                    mat1&#91;i]&#91;j] = in.nextInt();\n                }\n            }\n            for (int i = 0; i &lt; y; i++) {\n                for (int j = 0; j &lt; z; j++) {\n                    mat2&#91;i]&#91;j] = in.nextInt();\n                }\n            }\n            int&#91;]&#91;] res = solution.mul(mat1, mat2);\n            for (int i = 0; i &lt; x; i++) {\n                for (int j = 0; j &lt; z; j++) {\n                    System.out.print(res&#91;i]&#91;j] + \" \");\n                }\n                System.out.println();\n            }\n        }\n    } \n}<\/code><\/pre>\n","protected":false},"excerpt":{"rendered":"<p>\u8f93\u5165\u63cf\u8ff0\uff1a \u7b2c\u4e00\u884c\u5305\u542b\u4e00\u4e2a\u6b63\u6574\u6570&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":1122,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[2,4],"tags":[],"class_list":["post-1222","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-java","category-4"],"_links":{"self":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1222","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/comments?post=1222"}],"version-history":[{"count":0,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/posts\/1222\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media\/1122"}],"wp:attachment":[{"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/media?parent=1222"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/categories?post=1222"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/sanlangcode.com\/index.php\/wp-json\/wp\/v2\/tags?post=1222"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}