ICode9

精准搜索请尝试: 精确搜索
  • leetcode458 可怜的小猪2022-08-29 12:32:06

    思路: 数学。 实现: 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); } };  

专注分享技术,共同学习,共同进步。侵权联系[81616952@qq.com]

Copyright (C)ICode9.com, All Rights Reserved.

ICode9版权所有