TakeoffYoung

  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

2015年11月4日

摘要: 题意: 给两种宝石,体积S1,S2,价值V1,V2,背包容量n,求最大收益解决: 题目没有给数据范围,不过显然不能背包。 先考虑性价,假设宝石1性价比高于宝石2,则宝石2最多不可能拿超过lcm(s1, s2) / s2个。 否则的话,这部分就可以以性价比更高的代替以换取更多的价值。 枚举性价... 阅读全文
posted @ 2015-11-04 21:52 TakeoffYoung 阅读(287) 评论(0) 推荐(0) 编辑

摘要: 1 #include 2 #include 3 4 const int MAXN = 1e5+10; 5 6 bool dp[MAXN]; 7 int num[MAXN], val[MAXN]; 8 int l, n; 9 10 int main()11 {12 while (~s... 阅读全文
posted @ 2015-11-04 20:52 TakeoffYoung 阅读(181) 评论(0) 推荐(0) 编辑

摘要: A:(hdu2081)Solution: get the last five digits, not mod 100000 cause the leading zero.B:(hdu2075)C:(hdu2071)D:(hdu2070)Solution: The 40th fibonacci n... 阅读全文
posted @ 2015-11-04 09:42 TakeoffYoung 阅读(137) 评论(0) 推荐(0) 编辑