{"id":217,"date":"2010-04-09T20:39:00","date_gmt":"2010-04-09T12:39:00","guid":{"rendered":"http:\/\/localhost\/?p=217"},"modified":"2010-04-09T20:39:00","modified_gmt":"2010-04-09T12:39:00","slug":"scoi2009_happy_birthday","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/wjmzbmr\/?p=217","title":{"rendered":"[SCOI2009]\u751f\u65e5\u5feb\u4e50"},"content":{"rendered":"\n<p>[SCOI2009]\u751f\u65e5\u5feb\u4e50 <\/p>\n<p>Time Limit:1000MS&#160; Memory Limit:165536K<br \/>Total Submit:50 Accepted:41<\/p>\n<p><strong>Description <\/strong><\/p>\n<p> windy\u7684\u751f\u65e5\u5230\u4e86\uff0c\u4e3a\u4e86\u5e86\u795d\u751f\u65e5\uff0c\u4ed6\u7684\u670b\u53cb\u4eec\u5e2e\u4ed6\u4e70\u4e86\u4e00\u4e2a\u8fb9\u957f\u5206\u522b\u4e3a X \u548c Y \u7684\u77e9\u5f62\u86cb\u7cd5\u3002 <br \/>\u73b0\u5728\u5305\u62ecwindy\uff0c\u4e00\u5171\u6709 N \u4e2a\u4eba\u6765\u5206\u8fd9\u5757\u5927\u86cb\u7cd5\uff0c\u8981\u6c42\u6bcf\u4e2a\u4eba\u5fc5\u987b\u83b7\u5f97\u76f8\u540c\u9762\u79ef\u7684\u86cb\u7cd5\u3002 <br \/>windy\u4e3b\u5200\uff0c\u6bcf\u4e00\u5207\u53ea\u80fd\u5e73\u884c\u4e8e\u4e00\u5757\u86cb\u7cd5\u7684\u4e00\u8fb9\uff08\u4efb\u610f\u4e00\u8fb9\uff09\uff0c\u5e76\u4e14\u5fc5\u987b\u628a\u8fd9\u5757\u86cb\u7cd5\u5207\u6210\u4e24\u5757\u3002 <br \/>\u8fd9\u6837\uff0c\u8981\u5207\u6210 N \u5757\u86cb\u7cd5\uff0cwindy\u5fc5\u987b\u5207 N-1 \u6b21\u3002 <br \/>\u4e3a\u4e86\u4f7f\u5f97\u6bcf\u5757\u86cb\u7cd5\u770b\u8d77\u6765\u6f02\u4eae\uff0c\u6211\u4eec\u8981\u6c42 N \u5757\u86cb\u7cd5\u7684\u957f\u8fb9\u4e0e\u77ed\u8fb9\u7684\u6bd4\u503c\u7684\u6700\u5927\u503c\u6700\u5c0f\u3002 <br \/>\u4f60\u80fd\u5e2e\u52a9windy\u6c42\u51fa\u8fd9\u4e2a\u6bd4\u503c\u4e48\uff1f <\/p>\n<p><strong>Input <\/strong><\/p>\n<p> \u5305\u542b\u4e09\u4e2a\u6574\u6570\uff0cX Y N\u3002 <\/p>\n<p><strong>Output <\/strong><\/p>\n<p> \u5305\u542b\u4e00\u4e2a\u6d6e\u70b9\u6570\uff0c\u4fdd\u75596\u4f4d\u5c0f\u6570\u3002 <\/p>\n<p><strong>Sample Input <\/strong><\/p>\n<p>5 5 5<\/p>\n<p><strong>Sample Output <\/strong><\/p>\n<p>1.800000<\/p>\n<p><strong>Hint <\/strong><\/p>\n<p> \u3010\u6570\u636e\u89c4\u6a21\u548c\u7ea6\u5b9a\u3011 <br \/>100%\u7684\u6570\u636e\uff0c\u6ee1\u8db3 1 &lt;= X,Y &lt;= 10000 \uff1b 1 &lt;= N &lt;= 10 \u3002 <\/p>\n<p><strong>Source <\/strong><\/p>\n<p> Day1<\/p>\n<p>\u6655\u3002\u3002\u5b9e\u9645\u4e0a\u662f\u6c34\u9898\u554a\u3002\u3002\u76f4\u63a5\u641c\u7d22\u5c31\u53ef\u4ee5\u4e86\u56e7\u3002\u3002\u4ee5\u524d\u6211\u8fd8\u4ee5\u4e3a\u662f\u795e\u725b\u9898\u6655\u3002\u3002<br \/>\u5929\u554a\u3002\u3002\u540e\u5929\u5c31\u8981\u6570\u5b66\u7ade\u8d5b\u4e86\u6211\u5c45\u7136\u5728\u62fc\u547d\u641eOI\u56e7\u3002\u3002\u3002<br \/>Code\uff1a<\/p>\n<p>#include &lt;algorithm&gt;<br \/>#include &lt;cstdio&gt;<br \/>using namespace std;<br \/>double dfs(double x,double y,int c)<br \/>{<br \/>    if(x&gt;y)swap(x,y);<br \/>    if(c==1)return y\/x;double ret=1e20,r=1.0\/c;<br \/>    for(int i=1;i&lt;c;i++)<br \/>        ret&lt;?=max(dfs(x*r*i,y,i),dfs(x-x*r*i,y,c-i)),<br \/>        ret&lt;?=max(dfs(x,y*r*i,i),dfs(x,y-y*r*i,c-i));<br \/>    return ret;<br \/>}<br \/>int main()<br \/>{<br \/>    double x,y;int n;<br \/>    scanf(&quot;%lf %lf %d&quot;,&amp;x,&amp;y,&amp;n);<br \/>    printf(&quot;%0.6fn&quot;,dfs(x,y,n));<br \/>}<\/p>\n","protected":false},"excerpt":{"rendered":"<p>[SCOI2009]\u751f\u65e5\u5feb\u4e50 Time Limit:1000MS&#160; Memory Limit:165536KTotal Submit:50 Accepted:41 Description windy\u7684\u751f\u65e5\u5230\u4e86\uff0c\u4e3a\u4e86\u5e86\u795d\u751f\u65e5\uff0c\u4ed6\u7684\u670b\u53cb\u4eec\u5e2e\u4ed6\u4e70\u4e86\u4e00\u4e2a\u8fb9\u957f\u5206\u522b\u4e3a X \u548c Y \u7684\u77e9\u5f62\u86cb\u7cd5\u3002 \u73b0\u5728\u5305\u62ecwindy\uff0c\u4e00\u5171\u6709 N \u4e2a\u4eba\u6765\u5206\u8fd9\u5757\u5927\u86cb\u7cd5\uff0c\u8981\u6c42\u6bcf\u4e2a\u4eba\u5fc5\u987b\u83b7\u5f97\u76f8\u540c\u9762\u79ef\u7684\u86cb\u7cd5\u3002 windy\u4e3b\u5200\uff0c\u6bcf\u4e00\u5207\u53ea\u80fd\u5e73\u884c\u4e8e\u4e00\u5757\u86cb\u7cd5\u7684\u4e00\u8fb9\uff08\u4efb\u610f\u4e00\u8fb9\uff09\uff0c\u5e76\u4e14\u5fc5\u987b\u628a\u8fd9\u5757\u86cb\u7cd5\u5207\u6210\u4e24\u5757\u3002 \u8fd9\u6837\uff0c\u8981\u5207\u6210 N \u5757\u86cb\u7cd5\uff0cwindy\u5fc5\u987b\u5207 N-1 \u6b21\u3002 \u4e3a\u4e86\u4f7f\u5f97\u6bcf\u5757\u86cb\u7cd5\u770b\u8d77\u6765\u6f02\u4eae\uff0c\u6211\u4eec\u8981\u6c42 N \u5757\u86cb\u7cd5\u7684\u957f\u8fb9\u4e0e\u77ed\u8fb9\u7684\u6bd4\u503c\u7684\u6700\u5927\u503c\u6700\u5c0f\u3002 \u4f60\u80fd\u5e2e\u52a9windy\u6c42\u51fa\u8fd9\u4e2a\u6bd4\u503c\u4e48\uff1f Input \u5305\u542b\u4e09\u4e2a\u6574\u6570\uff0cX Y N\u3002 Output \u5305\u542b\u4e00\u4e2a\u6d6e\u70b9\u6570\uff0c\u4fdd\u75596\u4f4d\u5c0f\u6570\u3002 Sample Input 5 5 5 Sample Output 1.800000 Hint \u3010\u6570\u636e\u89c4\u6a21\u548c\u7ea6\u5b9a\u3011 100%\u7684\u6570\u636e\uff0c\u6ee1\u8db3 1 &lt;= X,Y &lt;= 10000 \uff1b 1 &lt;= N &lt;= 10 \u3002 [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":[],"categories":[10],"tags":[],"jetpack_featured_media_url":"","_links":{"self":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/217"}],"collection":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=217"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/217\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=217"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=217"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=217"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}