{"width":"100%","author_name":"a_kawashiro","blog_title":"a_kawashiro\u306e\u30d6\u30ed\u30b0","image_url":null,"provider_url":"https://hatena.blog","title":"SRM420 div1 medium","html":"<iframe src=\"https://hatenablog-parts.com/embed?url=https%3A%2F%2Fa-kawashiro.hatenablog.com%2Fentry%2F20110417%2F1303028791\" title=\"SRM420 div1 medium - a_kawashiro\u306e\u30d6\u30ed\u30b0\" class=\"embed-card embed-blogcard\" scrolling=\"no\" frameborder=\"0\" style=\"display: block; width: 100%; height: 190px; max-width: 500px; margin: 10px 0px;\"></iframe>","description":"DP[r][b]=max(r-b,\u8d64\u3092\u5f15\u304f\u78ba\u7387*DP[r+1][b]+\u9ed2\u3092\u5f15\u304f\u78ba\u7387*DP[r][b+1])\u3067DP\u3002 \u305d\u306e\u307e\u307e\u30e1\u30e2\u30ea\u306b\u53d6\u308b\u3068MLE\u3059\u308b\u306e\u3067\u3001r+1\u307e\u305f\u306fb+1\u3057\u304b\u306a\u3044\u6027\u8cea\u3092\u5229\u7528\u3057\u3066\u30e1\u30e2\u30ea\u3092\u7bc0\u7d04\u3002 #include <algorithm> using namespace std; class RedIsGood { public: double getProfit(int R, int B) { double DP[2][5010]; for(int i=0;i<=B+1;i++) DP[(R+1)%2][i]=0.0; for(int r=R;0<=r;r--) { for(in\u2026","version":"1.0","type":"rich","published":"2011-04-17 17:26:31","author_url":"https://blog.hatena.ne.jp/a_kawashiro/","categories":["topcoder"],"height":"190","url":"https://a-kawashiro.hatenablog.com/entry/20110417/1303028791","provider_name":"Hatena Blog","blog_url":"https://a-kawashiro.hatenablog.com/"}