摘要:
算法笔记 模板: POJ - 3468A Simple Problem with Integers 代码: #include<iostream> #include<cstdio> using namespace std; #define ll long long #define ls rt<<1,l 阅读全文
摘要:
C - Om Nom and Candies 思路:贪心+思维(或者叫数学)。假设最大值max(wr,wb)为wr,当c/wr小于√c时,可以枚举r糖的数量(从0到c/wr),更新答案,复杂度√c;否则,假设hr/wr<hb/wr,得到hr*wb<hb*wr,由这个等式可知,在有wb*wr重量限制的 阅读全文