{"id":504,"date":"2011-12-24T13:25:00","date_gmt":"2011-12-24T05:25:00","guid":{"rendered":"http:\/\/localhost\/?p=504"},"modified":"2011-12-24T13:25:00","modified_gmt":"2011-12-24T05:25:00","slug":"topcoder_srm_5265_problem_solutions","status":"publish","type":"post","link":"https:\/\/www.shuizilong.com\/wjmzbmr\/?p=504","title":{"rendered":"TopCoder SRM 526.5 \u9898\u89e3"},"content":{"rendered":"\n<p>250\uff1a<\/p>\n<p>\u505a\u6cd5\u5f88\u591a\uff0c\u6211\u7528\u7684\u662f\u6700\u66b4\u529b\u7684\u4e00\u79cd\uff0c\u8003\u8651\u4e00\u4e2a\u6570x\uff0c\u5b83\u5982\u679c\u662f\u5b8c\u5168\u5e73\u65b9\u6570\uff0c\u90a3\u4e48\u5b83\u4e0b\u4e00\u8f6e\u5c31\u8dea\u4e86\uff0c\u5426\u5219\u5b83\u4e0b\u4e00\u8f6e\u7684\u4f4d\u7f6e\u662f<\/p>\n<p>x-sqrt(x)\uff0csqrt(x)\u53d6\u4e0b\u6574\u3002<\/p>\n<p>\u7531\u4e8e\u6ca1\u5220\u6389\u7684\u6570\u4e4b\u95f4\u7684\u987a\u5e8f\u4e0d\u4f1a\u53d8\u3002<\/p>\n<p>\u6211\u4eec\u663e\u7136\u662f\u8981\u627e\u5230\u4e00\u4e2a\u6700\u5927\u7684\u6570\uff0c\u5b83\u5728\u53d8\u62101\u4e4b\u524d\u6ca1\u6709\u8dea\uff0c\u90a3\u4e48\u6211\u4eec\u4ecen\u52301\u66b4\u529b\u5224\u65ad\u3002\u3002\u3002\u3002<\/p>\n<p>\u8fd9\u4e2a\u901f\u5ea6\u5f88\u6162\u3002\u3002Java\u4f1aT\u3002\u3002\u6539\u6210C++\u5c31\u80fd\u5361\u8fc7\u3002\u3002\u3002<\/p>\n<p>500\uff1a<\/p>\n<p>\u6ce8\u610f\u5230\u671f\u671b\u7684\u5e73\u65b9\u4e0d\u5177\u6709\u53ef\u52a0\u6027\uff0c\u548b\u529e\u5462\u3002\u3002<\/p>\n<p>\u6ce8\u610f\u5230Sum(a1+..an) ^2 = Sum(ai*aj){i in [1,n],j in[1,n]}<\/p>\n<p>\u90a3\u4e48\u4e00\u4e2a\u70b9\u4e0a\u7684\u548c\u5e73\u65b9\u7684\u671f\u671b\uff0c\u5c31\u7b49\u4e8e\u6bcf\u5bf9\u4e2arange\u5728\u8fd9\u4e2a\u70b9\u4e0a\u76f8\u9047\u7684\u671f\u671b\u6b21\u6570\u7684\u548c<\/p>\n<p>\u540e\u8005\u662f\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u6570\u5b66\u8ba1\u7b97\u5f97\u51fa\u7684\u3002<\/p>\n<p>&nbsp;<\/p>\n<p>1000\uff1a<\/p>\n<p>\u786e\u4fdd\u4f60\u4f1a\u505ahttp:\/\/community.topcoder.com\/stat?c=problem_statement&amp;pm=8587\u8fd9\u9898<\/p>\n<p>SRM396 1000pt<\/p>\n<p>\u6211\u4eec\u8981\u627e\u51fa\u4e00\u4e2a\u6700\u5927\u7684\uff0c\u72ec\u7acb\u7684\u5b50\u7a7a\u95f4\uff0c\u4f7f\u5f97Sum(Red)*Sum(Blue)\u6700\u5c0f<\/p>\n<p>\u6211\u4eec\u8003\u8651\u6240\u6709\u8fd9\u4e9b\u5b50\u7a7a\u95f4\uff0c\u5b83\u4eec\u7684\uff08sumRed\uff0csumBlue\uff09\u7ec4\u6210\u7684\u70b9\u96c6\u5408\u3002<\/p>\n<p>\u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u6ce8\u610f\u5230\uff0c\u7b54\u6848\u53ea\u53ef\u80fd\u5728\u8fd9\u4e2a\u70b9\u96c6\u5408\u7684\u51f8\u5305\u4e0a\uff01<\/p>\n<p>\u90a3\u4e48\u6211\u4eec\u6765\u529e\u6cd5\u641e\u51fa\u51f8\u5305\u4e0a\u7684\u6240\u6709\u70b9\u5c31\u884c\u4e86\u3002\u3002<\/p>\n<p>\u6253\u4e2a\u6bd4\u65b9\u8bf4\uff0c\u6211\u4eec\u7ed9\u4e00\u4e2a\u659c\u7387k\uff0c\u7136\u540e\u628a\u6240\u6709\u4fe1\u5c01\u6309red*k+blue\u6392\u5e8f\uff0c\u7136\u540e\u7528SRM396 1000pt\u7684\u505a\u6cd5<\/p>\n<p>\u6211\u4eec\u5c31\u80fd\u5f97\u5230\u4e00\u4e2a\u6700\u5927\u72ec\u7acb\u5b50\u7a7a\u95f4\uff0c\u5b83\u7684k*sumRed+sumBlue\u6700\u5c0f<\/p>\n<p>\u8fd9\u610f\u5473\u8fd9\uff0c\u5b83\u5c31\u662f\u659c\u7387k\u7684\u76f4\u7ebf\uff0c\u4e00\u76f4\u5f80\u4e0b\u538b\u6240\u78b0\u5230\u7684\u51f8\u5305\u4e0a\u7684\u4e00\u4e2a\u70b9\uff01\uff01\uff01<\/p>\n<p>\u6839\u636e\u6807\u7a0b\u6211\u4eec\u53ea\u8981\u641e\u51fa\u6240\u6709\u6709\u53ef\u80fd\u6210\u4e3a\u7b54\u6848\u7684\u659c\u7387\uff0c\u8ba1\u7b97\u5373\u53ef\u3002\u3002<\/p>\n<p>\u4e0d\u8fc7\u6211\u968f\u673a\u4e86\u5f88\u591a\u659c\u7387\u3002\u3002\u4e5f\u8fc7\u4e86\u3002\u3002<\/p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>250\uff1a \u505a\u6cd5\u5f88\u591a\uff0c\u6211\u7528\u7684\u662f\u6700\u66b4\u529b\u7684\u4e00\u79cd\uff0c\u8003\u8651\u4e00\u4e2a\u6570x\uff0c\u5b83\u5982\u679c\u662f\u5b8c\u5168\u5e73\u65b9\u6570\uff0c\u90a3\u4e48\u5b83\u4e0b\u4e00\u8f6e\u5c31\u8dea\u4e86\uff0c\u5426\u5219\u5b83\u4e0b\u4e00\u8f6e\u7684\u4f4d\u7f6e\u662f x-sqrt(x)\uff0csqrt(x)\u53d6\u4e0b\u6574\u3002 \u7531\u4e8e\u6ca1\u5220\u6389\u7684\u6570\u4e4b\u95f4\u7684\u987a\u5e8f\u4e0d\u4f1a\u53d8\u3002 \u6211\u4eec\u663e\u7136\u662f\u8981\u627e\u5230\u4e00\u4e2a\u6700\u5927\u7684\u6570\uff0c\u5b83\u5728\u53d8\u62101\u4e4b\u524d\u6ca1\u6709\u8dea\uff0c\u90a3\u4e48\u6211\u4eec\u4ecen\u52301\u66b4\u529b\u5224\u65ad\u3002\u3002\u3002\u3002 \u8fd9\u4e2a\u901f\u5ea6\u5f88\u6162\u3002\u3002Java\u4f1aT\u3002\u3002\u6539\u6210C++\u5c31\u80fd\u5361\u8fc7\u3002\u3002\u3002 500\uff1a \u6ce8\u610f\u5230\u671f\u671b\u7684\u5e73\u65b9\u4e0d\u5177\u6709\u53ef\u52a0\u6027\uff0c\u548b\u529e\u5462\u3002\u3002 \u6ce8\u610f\u5230Sum(a1+..an) ^2 = Sum(ai*aj){i in [1,n],j in[1,n]} \u90a3\u4e48\u4e00\u4e2a\u70b9\u4e0a\u7684\u548c\u5e73\u65b9\u7684\u671f\u671b\uff0c\u5c31\u7b49\u4e8e\u6bcf\u5bf9\u4e2arange\u5728\u8fd9\u4e2a\u70b9\u4e0a\u76f8\u9047\u7684\u671f\u671b\u6b21\u6570\u7684\u548c \u540e\u8005\u662f\u53ef\u4ee5\u901a\u8fc7\u7b80\u5355\u7684\u6570\u5b66\u8ba1\u7b97\u5f97\u51fa\u7684\u3002 &nbsp; 1000\uff1a \u786e\u4fdd\u4f60\u4f1a\u505ahttp:\/\/community.topcoder.com\/stat?c=problem_statement&amp;pm=8587\u8fd9\u9898 SRM396 1000pt \u6211\u4eec\u8981\u627e\u51fa\u4e00\u4e2a\u6700\u5927\u7684\uff0c\u72ec\u7acb\u7684\u5b50\u7a7a\u95f4\uff0c\u4f7f\u5f97Sum(Red)*Sum(Blue)\u6700\u5c0f \u6211\u4eec\u8003\u8651\u6240\u6709\u8fd9\u4e9b\u5b50\u7a7a\u95f4\uff0c\u5b83\u4eec\u7684\uff08sumRed\uff0csumBlue\uff09\u7ec4\u6210\u7684\u70b9\u96c6\u5408\u3002 \u90a3\u4e48\u6211\u4eec\u53ef\u4ee5\u6ce8\u610f\u5230\uff0c\u7b54\u6848\u53ea\u53ef\u80fd\u5728\u8fd9\u4e2a\u70b9\u96c6\u5408\u7684\u51f8\u5305\u4e0a\uff01 \u90a3\u4e48\u6211\u4eec\u6765\u529e\u6cd5\u641e\u51fa\u51f8\u5305\u4e0a\u7684\u6240\u6709\u70b9\u5c31\u884c\u4e86\u3002\u3002 \u6253\u4e2a\u6bd4\u65b9\u8bf4\uff0c\u6211\u4eec\u7ed9\u4e00\u4e2a\u659c\u7387k\uff0c\u7136\u540e\u628a\u6240\u6709\u4fe1\u5c01\u6309red*k+blue\u6392\u5e8f\uff0c\u7136\u540e\u7528SRM396 1000pt\u7684\u505a\u6cd5 \u6211\u4eec\u5c31\u80fd\u5f97\u5230\u4e00\u4e2a\u6700\u5927\u72ec\u7acb\u5b50\u7a7a\u95f4\uff0c\u5b83\u7684k*sumRed+sumBlue\u6700\u5c0f \u8fd9\u610f\u5473\u8fd9\uff0c\u5b83\u5c31\u662f\u659c\u7387k\u7684\u76f4\u7ebf\uff0c\u4e00\u76f4\u5f80\u4e0b\u538b\u6240\u78b0\u5230\u7684\u51f8\u5305\u4e0a\u7684\u4e00\u4e2a\u70b9\uff01\uff01\uff01 \u6839\u636e\u6807\u7a0b\u6211\u4eec\u53ea\u8981\u641e\u51fa\u6240\u6709\u6709\u53ef\u80fd\u6210\u4e3a\u7b54\u6848\u7684\u659c\u7387\uff0c\u8ba1\u7b97\u5373\u53ef\u3002\u3002 \u4e0d\u8fc7\u6211\u968f\u673a\u4e86\u5f88\u591a\u659c\u7387\u3002\u3002\u4e5f\u8fc7\u4e86\u3002\u3002<\/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\/504"}],"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=504"}],"version-history":[{"count":0,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=\/wp\/v2\/posts\/504\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=504"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=504"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.shuizilong.com\/wjmzbmr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=504"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}