设为首页 加入收藏

TOP

UVA - 11986 Save from Radiation(二)
2015-07-20 17:56:18 来源: 作者: 【 】 浏览:11
Tags:UVA 11986 Save from Radiation
n also be determined. So, there can be many options, but you need at least 2 rats.

题意:其实就是求n个普通液体和一瓶毒液,求最少需要几只老鼠同时实验,找出毒液

思路:其实就是能有几个2组成,不够的也要算

#include 
  
   
#include 
   
     #include 
    
      #include 
     
       using namespace std; int main() { int t; int cas = 1; long long n, ans; scanf("%d", &t); while (t--) { scanf("%lld", &n); ans = 0; while (n) { ans++; n /= 2; } printf("Case %d: ", cas++); printf("%lld\n", ans); } return 0; }
     
    
   
  


首页 上一页 1 2 下一页 尾页 2/2/2
】【打印繁体】【投稿】【收藏】 【推荐】【举报】【评论】 【关闭】 【返回顶部
分享到: 
上一篇poj 3070 Fibonacci (矩阵快速幂.. 下一篇hdu 1573 X问题

评论

帐  号: 密码: (新用户注册)
验 证 码:
表  情:
内  容: