{"id":98,"date":"2024-04-26T10:21:30","date_gmt":"2024-04-26T02:21:30","guid":{"rendered":"https:\/\/seanxd.com\/?p=98"},"modified":"2024-04-26T10:21:32","modified_gmt":"2024-04-26T02:21:32","slug":"zerojudge-a410","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-a410\/","title":{"rendered":"ZeroJudge A410: \u89e3\u65b9\u7a0b"},"content":{"rendered":"\n\n\n<p class=\"\">\u8a71\u8aaa\u540c\u5b78\u5011\u6b63\u5728\u5b78\u7fd2\u4e8c\u5143\u4e00\u6b21\u65b9\u7a0b\u7d44\u3002<br>\u4e8c\u5143\u4e00\u6b21\u65b9\u7a0b\u7d44\u7684\u7df4\u7fd2\u984c\u92ea\u5929\u84cb\u5730\u5730\u6e67\u5411\u540c\u5b78\u5011\uff0c\u540c\u5b78\u5011\u6b63\u82e6\u60f1\u65bc\u4e00\u6b21\u6b21\u5730\u56db\u5247\u904b\u7b97\u3001\u79fb\u9805\u3001\u5408\u4f75\u540c\u985e\u9805\u7b49\u7b49\u3002<br>\u4ed6\u5011\u77e5\u9053\u4f60\u5f88\u8070\u660e\uff0c\u60f3\u8acb\u4f60\u5e6b\u4ed6\u5011\u7de8\u4e00\u500b\u89e3\u4e8c\u5143\u4e00\u6b21\u65b9\u7a0b\u7d44\u7684\u7a0b\u5f0f\u3002<br>\u6211\u5011\u5047\u5b9a\u4e8c\u5143\u4e00\u6b21\u65b9\u7a0b\u7d44\u7684\u4e00\u822c\u683c\u5f0f\u5982\u4e0b\uff1a(a\u3001b\u3001c\u3001d\u3001e\u3001f \u70ba\u5e38\u6578\uff0cx\u3001y \u70ba\u672a\u77e5\u6578)<br>ax + by = c<br>dx + ey = f<br>\u7a0b\u5f0f\u8b80\u5165 a\u3001b\u3001c\u3001d\u3001e\u3001f \u5f8c\uff0c\u8f38\u51fa\u89e3\u3002<br>\u7576\u7136\uff0c\u65b9\u7a0b\u7d44\u4e5f\u6709\u53ef\u80fd\u5b58\u5728\u7121\u89e3\u6216\u6709\u7121\u7aae\u89e3\u7684\u60c5\u6cc1\uff1a\u5982\u679c (x, y) \u6c92\u6709\u76f8\u5c0d\u61c9\u7684\u5be6\u6578\u5c0d\u6eff\u8db3\u65b9\u7a0b\u7d44\u5247\u7121\u89e3\uff1b\u76f8\u53cd\uff0c\u5982\u679c (x, y) \u6709\u591a\u7d44\u5c0d\u61c9\u7684\u5be6\u6578\u5c0d\u6eff\u8db3\u65b9\u7a0b\u7d44\u5247\u6709\u7121\u6578\u89e3\u3002<br>\u5982\u679c\u7121\u89e3\uff0c\u5c31\u8f38\u51fa\u300cNo answer\u300d\uff1b\u5982\u679c\u6709\u7121\u7aae\u89e3\uff0c\u5c31\u8f38\u51fa\u300cToo many\u300d\u3002<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">\u7bc4\u4f8b\u6e2c\u8cc7<\/h2>\n\n\n\n<figure class=\"wp-block-table nfd-wb-animate nfd-wb-fade-in-bottom-short\"><table class=\"has-fixed-layout\"><thead><tr><th>\u7bc4\u4f8b\u8f38\u5165<\/th><th>\u7bc4\u4f8b\u8f38\u51fa<\/th><\/tr><\/thead><tbody><tr><td>\u8f38\u5165\u50c51\u884c\uff0c\u5305\u542b6\u500b\u6574\u6578 (a\u3001b\u3001c\u3001d\u3001e\u3001f)\u3002\u8f38\u5165\u8cc7\u6599\u4fdd\u8b49\u6b63\u78ba\u3002<\/td><td>\u5982\u679c\u6709\u89e3\uff0c\u90a3\u9ebc\u7b2c1\u884c\u8f38\u51fa\u300cx=\u300d\u548c x \u7684\u503c\uff0c\u7b2c2\u884c\u8f38\u51fa\u300cy=\u300d\u548c y \u7684\u503c\uff0c<strong>\u5747\u4fdd\u75592\u4f4d\u5c0f\u6578<\/strong>\uff0c\u8acb\u53c3\u8003\u7bc4\u4f8b\u8f38\u51fa\u3002<br>\u82e5<strong>\u7121\u89e3<\/strong>\u6216<strong>\u6709\u7121\u6578\u89e3<\/strong>\u5247\u4f9d\u8981\u6c42\u8f38\u51fa\u300cNo answer\u300d\u6216\u300cToo many\u300d\u3002<\/td><\/tr><tr><td>1  1  2  1  -1  0<\/td><td>x=1.00<br>y=1.00<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">\u89e3\u984c\u601d\u8def<\/h2>\n\n\n\n<p class=\"\">\u53ef\u4ee5\u4f7f\u7528\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\u4e2d\u7684\u516c\u5f0f\u4f86\u89e3\u9019\u500b\u65b9\u7a0b\u5f0f\u3002\u8f38\u51fa\u7684\u90e8\u5206\u53ef\u4ee5\u4f7f\u7528 Printf(&#8220;%.2f) \u4f86\u53ea\u8f38\u51fa\u5c0f\u6578\u9ede\u5f8c\u5169\u4f4d\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=a410\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge A410: \u89e3\u65b9\u7a0b<\/a><\/h3>\n\n\n\n<div class=\"hcb_wrap\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>#include &lt;iostream&gt;\n#include &lt;stdio.h&gt;\nusing namespace std;\n\nint main() {\n  int a1, b1, c1, a2, b2, c2;\n  scanf(&quot;%d%d%d%d%d%d&quot;, &a1, &b1, &c1, &a2, &b2, &c2);\n  int deltax1,deltax2,delta;\n  float x1, x2;\n  deltax1=c1*b2-b1*c2;\n  deltax2=a1*c2-c1*a2;\n  delta=a1*b2-a2*b1;\n  if(delta != 0)\n  {\n    x1=(float)deltax1\/delta;\n    x2=(float)deltax2\/delta;\n    printf(&quot;x=%.2f\\n&quot;, x1);\n    printf(&quot;y=%.2f\\n&quot;, x2);\n  }\n  else\n  {\n    if(deltax1==0 && deltax2==0)\n        cout&lt;&lt;&quot;Too many&quot;&lt;&lt;endl;\n    else\n        cout&lt;&lt;&quot;No answer&quot;&lt;&lt;endl;\n  }\n}\n\n\/\/ZeroJudge A410\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u8a71\u8aaa\u540c\u5b78\u5011\u6b63\u5728\u5b78\u7fd2\u4e8c\u5143\u4e00\u6b21\u65b9\u7a0b\u7d44\u3002\u4e8c\u5143\u4e00\u6b21\u65b9\u7a0b\u7d44\u7684\u7df4\u7fd2\u984c\u92ea\u5929\u84cb\u5730\u5730\u6e67\u5411\u540c\u5b78\u5011\uff0c\u540c\u5b78\u5011\u6b63\u82e6\u60f1\u65bc\u4e00\u6b21\u6b21\u5730\u56db\u5247\u904b\u7b97\u3001 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"nf_dc_page":"","footnotes":""},"categories":[6],"tags":[8,13,7],"class_list":["post-98","post","type-post","status-publish","format-standard","hentry","category-6","tag-8","tag-13","tag-7"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/98","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/comments?post=98"}],"version-history":[{"count":1,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/98\/revisions"}],"predecessor-version":[{"id":99,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/98\/revisions\/99"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=98"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=98"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=98"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}