TOJ 4102 White Rats

来源:互联网 发布:微信企业号 php源码 编辑:程序博客网 时间:2024/05/17 03:49

The description of this problem is misunderstanding.Because I can make one LAB rats drink wines till dead.

The portal:http://acm.tju.edu.cn/toj/showp4102.html

#include <cstdio>#include <cstdlib>#include <cmath>#include <cstring>long long f[105];void Deal_with(){    int T;    f[0] = 1;    for(int i=1;i<=32;i++){        f[i] = f[i-1] * 2;    }    scanf("%d",&T);    while(T--){        long long n;        scanf("%lld",&n);        for(int i=0;i<=32;i++){            if(f[i] >= n){                printf("%d\n",i);                break;            }        }    }}int main(void){    Deal_with();    return 0;}


0 0
原创粉丝点击