{"id":445,"date":"2024-05-03T16:05:16","date_gmt":"2024-05-03T08:05:16","guid":{"rendered":"https:\/\/seanxd.com\/?p=445"},"modified":"2024-05-03T16:05:19","modified_gmt":"2024-05-03T08:05:19","slug":"zerojudge-f754","status":"publish","type":"post","link":"https:\/\/seanxd.com\/en\/zerojudge-f754\/","title":{"rendered":"ZeroJudge F754: DD Cries"},"content":{"rendered":"<p class=\"\">\"DD,\" full name \"Dat Derek,\" stands at 156.4 cm tall and weighs 89.2 kg (though that was measured a few years ago; by now, it's probably over a hundred...)<\/p>\n\n\n\n<p class=\"\">He suffers from foot odor, doesn't care much about cleanliness, and doesn't bother to brush his dirty teeth. To him, a mouthful of yellow teeth is a symbol of fashion.<\/p>\n\n\n\n<p class=\"\">His hair is dirty and unkempt, never groomed, letting dandruff fly around like seeds being scattered.<\/p>\n\n\n\n<p class=\"\">He's often labeled with titles like \"dirty devil,\" \"loser,\" \"failure in life,\" \"chubby otaku\"... and the like.<\/p>\n\n\n\n<p class=\"\">However, he harbors a heart full of longing for love.<\/p>\n\n\n\n<p class=\"\">DD was bullied today. Please help him seek justice.<\/p>\n\n\n\n<p class=\"\">DD's $M will be evenly distributed among K people. (0 &lt; K &lt; M &lt; 300000000000)<\/p>\n\n\n\n<p class=\"\"><strong>If it cannot be divided evenly, the remaining money will be given to the last person.<\/strong><\/p>\n\n\n\n<p class=\"translation-block\">Please <strong>output which test case and which person received how much money<\/strong>, followed by \"DD! BAD!\"<\/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>The first line will contain an integer N.<br>Then there are N sets of data.<br>Each set of data consists of two integers, M and K.<\/td><td class=\"translation-block\">Please <strong>output which test case and which person received how much money<\/strong>, followed by \"DD! BAD!\"<\/td><\/tr><tr><td>2<br>1 1<br>4 3<\/td><td>Case 1 :<br>\u7b2c1\u4f4d : \u62ff1\u5143\u4e26\u8aaaDD! BAD!<br>Case 2 :<br>\u7b2c1\u4f4d : \u62ff1\u5143\u4e26\u8aaaDD! BAD!<br>\u7b2c2\u4f4d : \u62ff1\u5143\u4e26\u8aaaDD! BAD!<br>\u7b2c3\u4f4d : \u62ff2\u5143\u4e26\u8aaaDD! BAD!<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<h2 class=\"wp-block-heading\">Thought Process<\/h2>\n\n\n\n<p class=\"translation-block\">When collecting data for this problem, you need to use Long Long Int. In addition, K may be 0. When K is 0, you only need to output the number of the current case and then move on to the next case.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\">Sample Code\uff0d<a href=\"https:\/\/zerojudge.tw\/ShowProblem?problemid=f754\" target=\"_blank\" rel=\"noreferrer noopener\">ZeroJudge F754: DD Cries<\/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        long long int M, K;\n        cin &gt;&gt; M &gt;&gt; K;\n        cout &lt;&lt; &quot;Case &quot; &lt;&lt; i+1 &lt;&lt; &quot; :\\n&quot;;\n        if (K != 0)\n        {\n            long long int give = M\/K;\n            long long int last = 0;\n            if (M % K != 0) last = M % K;\n            for (int i = 1; i&lt;K; i++)\n            {\n                cout &lt;&lt; &quot;\u7b2c&quot; &lt;&lt; i &lt;&lt; &quot;\u4f4d : \u62ff&quot; &lt;&lt; give &lt;&lt; &quot;\u5143\u4e26\u8aaaDD! BAD!\\n&quot;;\n            }\n            cout &lt;&lt; &quot;\u7b2c&quot; &lt;&lt; K &lt;&lt; &quot;\u4f4d : \u62ff&quot; &lt;&lt; give+last &lt;&lt; &quot;\u5143\u4e26\u8aaaDD! BAD!\\n&quot;;\n        }\n    }\n}\n\n\/\/ZeroJudge F754\n\/\/Dr. SeanXD<\/code><\/pre><\/div>","protected":false},"excerpt":{"rendered":"<p>DD\uff0c\u5168\u540d\u300cDat Derek\u300d\uff0c\u8eab\u9ad8 156.4\uff0c\u9ad4\u91cd 89.2 (\u4e0d\u904e\u90a3\u662f\u5e7e\u5e74\u524d\u6e2c\u91cf\u7684\uff0c\u73fe\u5728\u65e9\u5c31\u7834\u767e\u4e86\u2026) [&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":[15,8,13,9],"class_list":["post-445","post","type-post","status-publish","format-standard","hentry","category-6","tag-long-long-int","tag-8","tag-13","tag-9"],"blocksy_meta":[],"_links":{"self":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/445","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=445"}],"version-history":[{"count":1,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/445\/revisions"}],"predecessor-version":[{"id":446,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/posts\/445\/revisions\/446"}],"wp:attachment":[{"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/media?parent=445"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/categories?post=445"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/seanxd.com\/en\/wp-json\/wp\/v2\/tags?post=445"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}