leetcode458 可怜的小猪
作者:互联网
思路:
数学。
实现:
class Solution { public: int poorPigs(int buckets, int minutesToDie, int minutesToTest) { int base=minutesToTest/minutesToDie+1; double eps=1e-8; return ceil(log(buckets)/log(base)-eps); } };
标签:小猪,minutesToDie,int,buckets,eps,leetcode458,minutesToTest,可怜,base 来源: https://www.cnblogs.com/wangyiming/p/16635549.html