{"id":356,"date":"2024-04-28T15:06:23","date_gmt":"2024-04-28T07:06:23","guid":{"rendered":"https:\/\/seanxd.com\/?p=356"},"modified":"2024-04-28T15:06:25","modified_gmt":"2024-04-28T07:06:25","slug":"zerojudge-d155","status":"publish","type":"post","link":"https:\/\/seanxd.com\/en\/zerojudge-d155\/","title":{"rendered":"ZeroJudge D155: Disappeared Moon\n\n<br>*This problem involves understanding of Chinese\/Mandarin."},"content":{"rendered":"<p class=\"\">\u6b63\u7576\u590f\u5b63\u8981\u904e\u53bb\u7684\u6642\u5019\uff0c\u5e7b\u60f3\u9109\u53c8\u518d\u4e00\u6b21\u767c\u751f\u7570\u8b8a<\/p>\n\n\n\n<p class=\"\">\u672c\u4f86\u5728\u9019\u4e00\u665a\u88cf\u6703\u51fa\u6eff\u6708\uff0c\u4f46\u662f\u6708\u4eae\u4f3c\u4e4e\u56e0\u70ba\u67d0\u4e9b\u4e8b\u6545\u800c\u6d88\u5931\u4e86<\/p>\n\n\n\n<p class=\"\">\u9019\u60c5\u6cc1\u5c0d\u4eba\u985e\u4f86\u8aaa\u6c92\u6709\u751a\u9ebc\u5927\u554f\u984c\uff0c\u4f46\u5c0d\u5996\u602a\u4f86\u8aaa\u5247\u662f\u6538\u95dc\u751f\u6b7b\u7684\u4e8b\u60c5<\/p>\n\n\n\n<p class=\"\">\u800c\u5728\u5e7b\u60f3\u9109\u68f2\u606f\u7684\u5996\u602a\uff0d\u516b\u96f2\u7d2b\u5bdf\u89ba\u5230\u9019\u6b21\u7570\u8b8a\u7684\u767c\u751f\uff0c\u56e0\u70ba\u81ea\u5df1\u4e00\u500b\u4eba\u4e0d\u65b9\u4fbf\u884c\u52d5<\/p>\n\n\n\n<p class=\"\">\u6240\u4ee5\u5c31\u9080\u8acb\u4e86\u535a\u9e97\u795e\u793e\u7684\u5deb\u5973\uff0d\u535a\u9e97\u9748\u5922\u4e00\u540c\u51fa\u767c\u89e3\u6c7a\u7570\u8b8a<\/p>\n\n\n\n<p class=\"\">\u4f46\u9748\u5922\u6b63\u70ba\u4e86\u795e\u793e\u65e5\u76ca\u77ed\u5c11\u7684\u9999\u6cb9\u9322\u7169\u60f1\uff0c\u4e26\u6c92\u6709\u5f88\u60f3\u53bb\u7684\u610f\u9858<\/p>\n\n\n\n<p class=\"translation-block\">\u65bc\u662f\u516b\u96f2\u7d2b\u5c31\u60f3\u51fa<strong>\u4ee5\u731c\u62f3\u7684\u65b9\u5f0f\u4f86\u6c7a\u5b9a\u53bb\u7559\u8207\u5426<\/strong><\/p>\n\n\n\n<p class=\"\">\u5047\u5982\u7d2b\u8d0f\u7684\u8a71\uff0c\u5c31\u7406\u6240\u7576\u7136\u4e00\u8d77\u51fa\u767c<\/p>\n\n\n\n<p class=\"\">\u5982\u679c\u662f\u9748\u5922\u8d0f\u7684\u8a71\uff0c\u7d2b\u5c31\u8981\u7559\u4e0b\u4f86\u4e00\u8d77\u7c4c\u63aa\u9999\u6cb9\u9322<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Sample Inputs\/Outputs<\/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>Sample Input(s)<\/th><th>Sample Output(s)<\/th><\/tr><\/thead><tbody><tr><td><strong>EOF<\/strong> \u8f38\u5165\uff0c\u6bcf\u7b46\u8f38\u5165\u4e2d\u6709\u5169\u7b46\u8cc7\u6599\uff0c\u524d\u8005\u70ba\u516b\u96f2\u7d2b\u51fa\u7684\u62f3\uff0c\u5f8c\u8005\u70ba\u9748\u5922\u7684\uff0c\u4e2d\u9593\u4ee5\u7a7a\u767d\u9593\u9694<br>\u7531\u65bc\u5169\u4eba\u90fd\u5c0d\u9700\u8981\u4e0d\u65b7\u7684\u51fa\u62f3\u611f\u5230\u75b2\u5026\u8207\u53ad\u7169<br>\u6240\u4ee5\u9748\u5922\u5c31\u62ff\u51fa\u4e09\u652f\u7c64<br>\u5206\u5225\u5beb\u4e0a(Scissors,Stone,Paper)\u4f86\u4ee3\u8868(\u526a\u5200\uff0c\u77f3\u982d,\u5e03)<br>\u7531\u5169\u4eba\u5404\u62bd\u4e00\u652f\u4f86\u6c7a\u5b9a\u8f38\u8d0f<br>\u56e0\u70ba\u90fd\u5404\u53ea\u6709\u4e00\u652f\u7c64\uff0c\u6240\u4ee5<strong>\u4e0d\u7528\u8003\u616e\u5e73\u624b\u7684\u554f\u984c<\/strong><br>\u9664\u4e86\u5c0d\u6bcf\u7b46\u6e2c\u8cc7\u8f38\u51fa\u8d0f\u5bb6\u4e4b\u5916<br><strong>\u9084\u9700\u8a08\u7b97\u8ab0\u8d0f\u7684\u52dd\u5834\u6578\u6700\u591a<\/strong><br>\u8f38\u5165\u7684\u6700\u5f8c\u70ba\u300cGame Over\u300d<br>\u9019\u6642\u8f38\u51fa\u7d50\u5c40<\/td><td class=\"translation-block\">\u9748\u5922\u8d0f\u7684\u8a71\u5c31\u8f38\u51fa\u300c\u9748\u5922\u7372\u52dd\u300d<br>\u53cd\u4e4b\u5247\u8f38\u51fa\u300c\u7d2b\u7372\u52dd\u300d<br>\u5728<strong>\u6bd4\u8f03\u5b8c\u52dd\u5834\u6578\u4e4b\u5f8c\u8f38\u51fa\u7d50\u5c40<\/strong><br>\u5047\u5982\u9748\u5922\u8d0f\u7684\u5834\u6578\u8f03\u591a<br>\u5247\u5728\u6700\u5f8c\u8f38\u51fa\u300c\u60b2\u6158\u7684\u7c4c\u63aa\u8d77\u9999\u6cb9\u9322\u300d<br>\u53cd\u4e4b\u5247\u8f38\u51fa\u300c\u87a2\u706b\u7684\u8e64\u8de1\u300d<\/td><\/tr><tr><td>Scissors Stone<br>Paper Stone<br>Paper Stone<br>Scissors Paper<br>Game Over<\/td><td>\u9748\u5922\u7372\u52dd<br>\u7d2b\u7372\u52dd<br>\u7d2b\u7372\u52dd<br>\u7d2b\u7372\u52dd<br>\u87a2\u706b\u7684\u8e64\u8de1<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Thought Process<\/h2>\n\n\n\n<p class=\"\">\u5c07\u67d0\u4e00\u500b\u4eba\u7684\u52dd\u5229\u689d\u4ef6\u8a2d\u70ba <strong>if<\/strong>\uff0c<strong>else<\/strong> \u5c31\u6703\u662f\u53e6\u5916\u4e00\u500b\u4eba\u52dd\u5229\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sample Code\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=d155\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge D155: Disappeared Moon\n\n<br>*This problem involves understanding of Chinese\/Mandarin.<\/a><\/h3>\n\n\n\n<div class=\"hcb_wrap nfd-wb-animate nfd-wb-reveal-right nfd-delay-50\"><pre class=\"prism line-numbers lang-cpp\" data-lang=\"C++\"><code>#include &lt;iostream&gt;\nusing namespace std;\n\nint main() {\n    string purple, dream;\n    int P = 0, D = 0;\n    while (cin &gt;&gt; purple &gt;&gt; dream && purple != &quot;Game&quot;)\n    {\n        if ((purple == &quot;Scissors&quot; && dream == &quot;Stone&quot;) || (purple == &quot;Stone&quot; && dream == &quot;Paper&quot;) || (purple == &quot;Paper&quot; && dream == &quot;Scissors&quot;))\n        {\n            D++;\n            cout &lt;&lt; &quot;\u9748\u5922\u7372\u52dd\\n&quot;;\n        }\n        else\n        {\n            P++;\n            cout &lt;&lt; &quot;\u7d2b\u7372\u52dd\\n&quot;;\n        }\n    }\n    if (P &gt; D) cout &lt;&lt; &quot;\u87a2\u706b\u7684\u8e64\u8de1\\n&quot;;\n    else cout &lt;&lt; &quot;\u60b2\u6158\u7684\u7c4c\u63aa\u8d77\u9999\u6cb9\u9322\\n&quot;;\n}\n\n\/\/ZeroJudge D155\n\/\/Dr. SeanXD<\/code><\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>\u6b63\u7576\u590f\u5b63\u8981\u904e\u53bb\u7684\u6642\u5019\uff0c\u5e7b\u60f3\u9109\u53c8\u518d\u4e00\u6b21\u767c\u751f\u7570\u8b8a \u672c\u4f86\u5728\u9019\u4e00\u665a\u88cf\u6703\u51fa\u6eff\u6708\uff0c\u4f46\u662f\u6708\u4eae\u4f3c\u4e4e\u56e0\u70ba\u67d0\u4e9b\u4e8b\u6545\u800c\u6d88\u5931\u4e86 \u9019\u60c5\u6cc1 [&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":[29],"tags":[8,11],"class_list":["post-356","post","type-post","status-publish","format-standard","hentry","category-zerojudge-","tag-8","tag-11"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/356","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/comments?post=356"}],"version-history":[{"count":1,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/356\/revisions"}],"predecessor-version":[{"id":357,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/356\/revisions\/357"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/media?parent=356"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/categories?post=356"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/tags?post=356"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}