{"id":234,"date":"2024-04-26T21:48:56","date_gmt":"2024-04-26T13:48:56","guid":{"rendered":"https:\/\/seanxd.com\/?p=234"},"modified":"2024-04-26T21:48:58","modified_gmt":"2024-04-26T13:48:58","slug":"zerojudge-a536","status":"publish","type":"post","link":"https:\/\/seanxd.com\/zh\/zerojudge-a536\/","title":{"rendered":"ZeroJudge A536: Soda Surpler"},"content":{"rendered":"\n\n\n<h4 class=\"wp-block-heading\">\u540c\u984c\uff1aUVa 11689 &#8211; Soda Surpler<\/h4>\n\n\n\n<p class=\"\">Tim \u662f\u4e00\u500b\u975e\u5e38\u611b\u559d\u6c7d\u6c34\u7684\u4eba\u3002\u7531\u65bc\u4ed6\u6c92\u6709\u9322\uff0c\u6240\u4ee5\u4ed6\u8981\u559d\u6c7d\u6c34\u7684\u552f\u4e00\u65b9\u6cd5\u5c31\u662f\u6536\u96c6\u7a7a\u6c7d\u6c34\u74f6\u5b50\uff0c\u7136\u5f8c<strong>\u62ff\u53bb\u56de\u6536\u63db\u53d6\u9322\u518d\u53bb\u8cb7\u65b0\u6c7d\u6c34\u4f86\u559d<\/strong>\u3002\u9664\u4e86\u4ed6\u81ea\u5df1\u559d\u5b8c\u7684\u7a7a\u74f6\u5b50\uff0cTim\u4e5f\u6703\u5230<strong>\u8857\u4e0a\u53bb\u6536\u96c6\u5225\u4eba\u559d\u5b8c\u7684\u7a7a\u74f6\u5b50<\/strong>\u3002\u6709\u4e00\u5929\uff0c\u4ed6\u975e\u5e38\u7684\u6e34\uff0c\u4ed6<strong>\u8981\u76e1\u53ef\u80fd\u7684\u559d\u6c7d\u6c34\uff0c\u76f4\u5230\u4ed6\u5f97\u4e0d\u5230\u4efb\u4f55\u4e00\u74f6\u70ba\u6b62<\/strong>\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\u7684\u7b2c 1 \u5217\u6709\u4e00\u500b\u6574\u6578 N\uff0c\u4ee3\u8868\u4ee5\u4e0b\u6709\u591a\u5c11\u7d44\u6e2c\u8a66\u8cc7\u6599\u3002<br>\u6bcf\u7d44\u6e2c\u8a66\u8cc7\u6599 1 \u5217\uff0c\u542b\u6709 3 \u500b\u6574\u6578 E\u3001F\u3001C \u3002E (0 &lt;= E &lt; 1000) \u4ee3\u8868 Tim \u4e00\u958b\u59cb\u64c1\u6709\u7684\u7a7a\u74f6\u5b50\u6578\u76ee\uff0cF (0 &lt;= F &lt; 1000) \u4ee3\u8868 Tim \u5728 \u9019\u4e00\u5929\u4ed6\u5728\u8857\u4e0a\u6536\u96c6\u5230\u7684\u7a7a\u74f6\u5b50\u6578\u76ee\uff0cC (1 &lt; C &lt; 2000) \u4ee3\u8868\u591a\u5c11\u500b\u7a7a\u74f6\u5b50\u53ef\u4ee5\u63db\u4e00\u74f6\u65b0\u7684\u6c7d\u6c34\u3002<\/td><td>\u5c0d\u6bcf\u4e00\u7d44\u6e2c\u8a66\u8cc7\u6599\u8f38\u51fa\u4e00\u5217\uff0c\u4ee3\u8868 Tim \u53ef\u4ee5\u559d\u5230\u591a\u5c11\u74f6\u6c7d\u6c34\u3002<\/td><\/tr><tr><td>2<br>9  0  3<br>5  5  2<\/td><td>4<br>9<\/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=\"\">\u672c\u984c\u53ef\u4ee5\u4f7f\u7528 <strong>While\u8ff4\u5708<\/strong> \u4f86\u505a\u6bcf\u4e00\u6b21\u7684\u5224\u65b7\uff0c\u6240\u6709<strong>\u7a7a\u74f6\u5b50\u7684\u6578\u91cf (\u521d\u59cb\u503c) \u5c31\u662f E + F<\/strong>\uff0c\u9700\u8981\u6ce8\u610f\u7684\u662f\uff0c<strong>\u7576\u63db\u4e86\u4e00\u74f6\u6c7d\u6c34\u4e4b\u5f8c\u5c31\u6703\u559d\u6389\uff0c\u6240\u4ee5\u7a7a\u74f6\u5b50\u7684\u6578\u91cf\u4e5f\u8981 +1<\/strong>\u3002<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">\u7bc4\u4f8b\u7a0b\u5f0f\u78bc\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=a536\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge A536: Soda Surpler<\/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    cin.sync_with_stdio(0);\n    cin.tie(0);\n    int N;\n    cin &gt;&gt; N;\n    for (int i = 0; i&lt;N; i++)\n    {\n        int E, F, C;\n        cin &gt;&gt; E &gt;&gt; F &gt;&gt; C;\n        int total = E+F;\n        int ans = 0;\n        while (total &gt;= C)\n        {\n            total -= C;\n            total++;\n            ans++;\n        }\n        cout &lt;&lt; ans &lt;&lt; &quot;\\n&quot;;\n    }\n}\n\n\/\/ZeroJudge A536\n\/\/Dr. SeanXD<\/code><\/pre><\/div>\n","protected":false},"excerpt":{"rendered":"<p>\u540c\u984c\uff1aUVa 11689 &#8211; Soda Surpler Tim \u662f\u4e00\u500b\u975e\u5e38\u611b\u559d\u6c7d\u6c34\u7684\u4eba\u3002\u7531\u65bc\u4ed6\u6c92\u6709 [&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":[18],"tags":[13,9],"class_list":["post-234","post","type-post","status-publish","format-standard","hentry","category-uva","tag-13","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/234","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=234"}],"version-history":[{"count":1,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/234\/revisions"}],"predecessor-version":[{"id":235,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/posts\/234\/revisions\/235"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/media?parent=234"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/categories?post=234"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/zh\/wp-json\/wp\/v2\/tags?post=234"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}