ZOJ 2545

#include <iostream>
#include <cstring>
#include <algorithm>
#include<cmath>
using namespace std;
int main()
{
    
    
    
    int n;
    while(scanf("%d",&n),n){
    
    
        if(n<1960)puts("0");
        else{
    
    
            int bits = 4<<((n-1960)/10);
            double t=0;
            int k=1;
            //cout<<(n-1960)%10<<endl;
            while(t<=bits){
    
    
                k++;
                t+=log2(k);
            }
            printf("%d\n",k-1);
        }
        
    }
}

猜你喜欢

转载自blog.csdn.net/weixin_39057744/article/details/120530088
ZOJ