{"id":118,"date":"2025-01-11T23:43:40","date_gmt":"2025-01-11T15:43:40","guid":{"rendered":"http:\/\/150.230.63.147\/blog\/?p=118"},"modified":"2025-01-11T23:43:40","modified_gmt":"2025-01-11T15:43:40","slug":"d-road-to-post-office-%e8%a7%a3%e6%9e%90%e6%80%9d%e7%b6%ad","status":"publish","type":"post","link":"https:\/\/blog.seekrealthing.net\/blog\/?p=118","title":{"rendered":"D. Road to Post Office \u89e3\u6790(\u601d\u7dad)"},"content":{"rendered":"\n<div class=\"wp-block-jetpack-markdown\"><h1>Codeforce 702 D. Road to Post Office \u89e3\u6790(\u601d\u7dad)<\/h1>\n<p>\u4eca\u5929\u6211\u5011\u4f86\u770b\u770bCF702D<br>\n<a href=\"https:\/\/codeforces.com\/problemset\/problem\/702\/D\">\u984c\u76ee\u9023\u7d50<\/a><\/p>\n<blockquote>\n<p><strong>\u984c\u76ee<\/strong><br>\n\u7565\uff0c\u8acb\u76f4\u63a5\u770b\u539f\u984c\u3002<\/p>\n<\/blockquote>\n<h3>\u524d\u8a00<\/h3>\n<p>\u539f\u672c\u60f3\u8aaa\u6703\u4e0d\u6703\u4e5f\u662f\u8981\u5217\u5f0f\u5b50\u89e3\u6216\u8005\u4e8c\u5206\u641c\uff0c\u6c92\u60f3\u5230\u610f\u5916\u7684\u662f\u601d\u8003\u975e\u5e38\u7c21\u55ae\u7684\u4e00\u984c<\/p>\n<h3>\u60f3\u6cd5<\/h3>\n<p>\u5982\u679c\u5750\u8eca$k$\u516c\u91cc\u52a0\u4e0a\u4fee\u7406\u6bd4\u8d70\u8def$k$\u516c\u91cc\u9084\u8981\u6162\uff0c\u90a3\u9ebc\u6211\u5011\u53ea\u9700\u8981\u5148\u5750\u8eca$k$\u516c\u91cc\uff0c\u7136\u5f8c\u4e0d\u8981\u4fee\uff0c\u76f4\u63a5\u8d70\u8def\u8d70\u5b8c\u5168\u7a0b\u3002<br>\n\u5982\u679c\u5750\u8eca$k$\u516c\u91cc\u52a0\u4e0a\u4fee\u7406\u6bd4\u8d70\u8def$k$\u516c\u91cc\u9084\u8981\u5feb\uff0c\u90a3\u9ebc\u6211\u5011\u53ea\u5269\u4e0b\u5169\u7a2e\u9078\u9805:<\/p>\n<ol>\n<li>\u5750\u8eca\u5750$k\\times\\lfloor\\frac{d}{k}\\rfloor$\u516c\u91cc\uff0c\u800c\u6700\u5f8c\u4e00\u6b21$k$\u516c\u91cc\u5750\u5b8c\u4ee5\u5f8c\u4e0d\u8981\u4fee\u8eca\uff0c\u5269\u4e0b\u8d70\u8def\u3002<\/li>\n<li>\u5168\u7a0b\u5750\u8eca\u3002<\/li>\n<\/ol>\n<p>\u8981\u8a18\u5f97\u8003\u616e$d&lt;k$\u7684\u60c5\u6cc1\u3002<\/p>\n<h3>\u7a0b\u5f0f\u78bc:<\/h3>\n<pre><code class=\"language-cpp=\">ll d,k,a,b,t;  \nmain(void) {ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);  \n  cin&gt;&gt;d&gt;&gt;k&gt;&gt;a&gt;&gt;b&gt;&gt;t;  \n  if(d&lt;k){cout&lt;&lt;min(a*d,b*d)&lt;&lt;'\\n';return 0;}  \n  if(a*k+t&gt;=b*k)cout&lt;&lt;a*k+b*(d-k)&lt;&lt;'\\n';  \n  else cout&lt;&lt;min(a*k*(d\/k)+t*(d\/k-1)+b*(d-k*(d\/k)),a*k*(d\/k)+t*(d\/k)+a*(d-k*(d\/k)))&lt;&lt;'\\n';  \n  return 0;  \n}  \n<\/code><\/pre>\n<p>\u6a19\u982d\u3001\u6a21\u677f\u8acb\u9edeSubmission\u770b<br>\n<a href=\"https:\/\/codeforces.com\/contest\/702\/submission\/93946003\">Submission<\/a><\/p>\n<\/div>\n","protected":false},"excerpt":{"rendered":"","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":"","jetpack_publicize_message":"","jetpack_publicize_feature_enabled":true,"jetpack_social_post_already_shared":false,"jetpack_social_options":{"image_generator_settings":{"template":"highway","enabled":false},"version":2}},"categories":[3],"tags":[10,9,8],"class_list":["post-118","post","type-post","status-publish","format-standard","hentry","category-ojcode","tag-codeforce","tag-ojcode","tag-8"],"jetpack_publicize_connections":[],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>D. Road to Post Office \u89e3\u6790(\u601d\u7dad) - Logic Formatting<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/blog.seekrealthing.net\/blog\/?p=118\" \/>\n<meta property=\"og:locale\" content=\"zh_TW\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"D. Road to Post Office \u89e3\u6790(\u601d\u7dad) - Logic Formatting\" \/>\n<meta property=\"og:url\" content=\"https:\/\/blog.seekrealthing.net\/blog\/?p=118\" \/>\n<meta property=\"og:site_name\" content=\"Logic Formatting\" \/>\n<meta property=\"article:published_time\" content=\"2025-01-11T15:43:40+00:00\" \/>\n<meta name=\"author\" content=\"jeff\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005:\" \/>\n\t<meta name=\"twitter:data1\" content=\"jeff\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9810\u4f30\u95b1\u8b80\u6642\u9593\" \/>\n\t<meta name=\"twitter:data2\" content=\"1 \u5206\u9418\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/?p=118#article\",\"isPartOf\":{\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/?p=118\"},\"author\":{\"name\":\"jeff\",\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/person\/233e80a0fee3d4706f067f2e88c0b454\"},\"headline\":\"D. Road to Post Office \u89e3\u6790(\u601d\u7dad)\",\"datePublished\":\"2025-01-11T15:43:40+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/?p=118\"},\"wordCount\":31,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#organization\"},\"keywords\":[\"codeforce\",\"ojcode\",\"\u601d\u7dad\"],\"articleSection\":[\"ojcode\"],\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/blog.seekrealthing.net\/blog\/?p=118#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/?p=118\",\"url\":\"https:\/\/blog.seekrealthing.net\/blog\/?p=118\",\"name\":\"D. Road to Post Office \u89e3\u6790(\u601d\u7dad) - Logic Formatting\",\"isPartOf\":{\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#website\"},\"datePublished\":\"2025-01-11T15:43:40+00:00\",\"breadcrumb\":{\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/?p=118#breadcrumb\"},\"inLanguage\":\"zh-TW\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/blog.seekrealthing.net\/blog\/?p=118\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/?p=118#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9801\",\"item\":\"https:\/\/blog.seekrealthing.net\/blog\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"D. Road to Post Office \u89e3\u6790(\u601d\u7dad)\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#website\",\"url\":\"https:\/\/blog.seekrealthing.net\/blog\/\",\"name\":\"Logic Formatting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/blog.seekrealthing.net\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-TW\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#organization\",\"name\":\"Logic Formatting\",\"url\":\"https:\/\/blog.seekrealthing.net\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/blog.seekrealthing.net\/blog\/wp-content\/uploads\/2025\/02\/android-chrome-512x512-1.png\",\"contentUrl\":\"https:\/\/blog.seekrealthing.net\/blog\/wp-content\/uploads\/2025\/02\/android-chrome-512x512-1.png\",\"width\":512,\"height\":512,\"caption\":\"Logic Formatting\"},\"image\":{\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/logo\/image\/\"}},{\"@type\":\"Person\",\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/person\/233e80a0fee3d4706f067f2e88c0b454\",\"name\":\"jeff\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-TW\",\"@id\":\"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/f9b571b28c252728386f0002b35d9cb9a9028f740b0f9ca5ad678e7eb21c4857?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/f9b571b28c252728386f0002b35d9cb9a9028f740b0f9ca5ad678e7eb21c4857?s=96&d=mm&r=g\",\"caption\":\"jeff\"},\"sameAs\":[\"http:\/\/150.230.63.147\/blog\"],\"url\":\"https:\/\/blog.seekrealthing.net\/blog\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"D. Road to Post Office \u89e3\u6790(\u601d\u7dad) - Logic Formatting","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/blog.seekrealthing.net\/blog\/?p=118","og_locale":"zh_TW","og_type":"article","og_title":"D. Road to Post Office \u89e3\u6790(\u601d\u7dad) - Logic Formatting","og_url":"https:\/\/blog.seekrealthing.net\/blog\/?p=118","og_site_name":"Logic Formatting","article_published_time":"2025-01-11T15:43:40+00:00","author":"jeff","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005:":"jeff","\u9810\u4f30\u95b1\u8b80\u6642\u9593":"1 \u5206\u9418"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/blog.seekrealthing.net\/blog\/?p=118#article","isPartOf":{"@id":"https:\/\/blog.seekrealthing.net\/blog\/?p=118"},"author":{"name":"jeff","@id":"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/person\/233e80a0fee3d4706f067f2e88c0b454"},"headline":"D. Road to Post Office \u89e3\u6790(\u601d\u7dad)","datePublished":"2025-01-11T15:43:40+00:00","mainEntityOfPage":{"@id":"https:\/\/blog.seekrealthing.net\/blog\/?p=118"},"wordCount":31,"commentCount":0,"publisher":{"@id":"https:\/\/blog.seekrealthing.net\/blog\/#organization"},"keywords":["codeforce","ojcode","\u601d\u7dad"],"articleSection":["ojcode"],"inLanguage":"zh-TW","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/blog.seekrealthing.net\/blog\/?p=118#respond"]}]},{"@type":"WebPage","@id":"https:\/\/blog.seekrealthing.net\/blog\/?p=118","url":"https:\/\/blog.seekrealthing.net\/blog\/?p=118","name":"D. Road to Post Office \u89e3\u6790(\u601d\u7dad) - Logic Formatting","isPartOf":{"@id":"https:\/\/blog.seekrealthing.net\/blog\/#website"},"datePublished":"2025-01-11T15:43:40+00:00","breadcrumb":{"@id":"https:\/\/blog.seekrealthing.net\/blog\/?p=118#breadcrumb"},"inLanguage":"zh-TW","potentialAction":[{"@type":"ReadAction","target":["https:\/\/blog.seekrealthing.net\/blog\/?p=118"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/blog.seekrealthing.net\/blog\/?p=118#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9801","item":"https:\/\/blog.seekrealthing.net\/blog"},{"@type":"ListItem","position":2,"name":"D. Road to Post Office \u89e3\u6790(\u601d\u7dad)"}]},{"@type":"WebSite","@id":"https:\/\/blog.seekrealthing.net\/blog\/#website","url":"https:\/\/blog.seekrealthing.net\/blog\/","name":"Logic Formatting","description":"","publisher":{"@id":"https:\/\/blog.seekrealthing.net\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/blog.seekrealthing.net\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-TW"},{"@type":"Organization","@id":"https:\/\/blog.seekrealthing.net\/blog\/#organization","name":"Logic Formatting","url":"https:\/\/blog.seekrealthing.net\/blog\/","logo":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/blog.seekrealthing.net\/blog\/wp-content\/uploads\/2025\/02\/android-chrome-512x512-1.png","contentUrl":"https:\/\/blog.seekrealthing.net\/blog\/wp-content\/uploads\/2025\/02\/android-chrome-512x512-1.png","width":512,"height":512,"caption":"Logic Formatting"},"image":{"@id":"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/logo\/image\/"}},{"@type":"Person","@id":"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/person\/233e80a0fee3d4706f067f2e88c0b454","name":"jeff","image":{"@type":"ImageObject","inLanguage":"zh-TW","@id":"https:\/\/blog.seekrealthing.net\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/f9b571b28c252728386f0002b35d9cb9a9028f740b0f9ca5ad678e7eb21c4857?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/f9b571b28c252728386f0002b35d9cb9a9028f740b0f9ca5ad678e7eb21c4857?s=96&d=mm&r=g","caption":"jeff"},"sameAs":["http:\/\/150.230.63.147\/blog"],"url":"https:\/\/blog.seekrealthing.net\/blog\/?author=1"}]}},"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/118","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=118"}],"version-history":[{"count":1,"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions"}],"predecessor-version":[{"id":119,"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=\/wp\/v2\/posts\/118\/revisions\/119"}],"wp:attachment":[{"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=118"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=118"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blog.seekrealthing.net\/blog\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=118"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}