• A . Add More Zero (log 求解 )


    There is a youngster known for amateur propositions concerning several mathematical hard problems.

    Today he is going to prepare a thought-provoking problem on a specific type of supercomputer which has the ability to support calculating operations for integers between 00 and (2m1)(2m−1) (inclusive).

    As a young man born with ten fingers, he loves the powers of 1010 so much, which results in his eccentricity that he always ranges integers he would like to use from 11 to 10k10k (inclusive).

    For ease of processing, all integers he would probably use in this interesting problem ought to be as computable as this supercomputer could.

    Given the positive integer mm, your task is to determine maximum possible integer kkthat is suitable for the specific supercomputer.

    Input

    The input contains multiple (about 105105) test cases.

    Each test case in only one line contains an integer mm (1m1051≤m≤105).

    Output

    For each test case, output "Case #x: y" in one line (without quotes), where xxindicates the case number starting from 11, and yy denotes the answer to the corresponding case.

    Example

    Input
    1
    64
    
    Output
    Case #1: 0
    Case #2: 19


    #include <iostream>
    #include <algorithm>
    #include <cstdio>
    #include <string>
    #include <cstring>
    #include <cstdlib>
    #include <map>
    #include <vector>
    #include <set>
    #include <queue>
    #include <stack>
    #include <cmath>
    typedef long long lli;
    using namespace std;
    const int  mxn = 1e9;
    #define TLE std::ios::sync_with_stdio(false);   cin.tie(NULL);   cout.tie(NULL);   cout.precision(10);
    multiset<int> v;
    multiset<int> :: iterator it ;
    int a[100+5];
    
    int main()
    {
        TLE;
        int n,cnt=1;
        while(cin>>n)
        {
            cout<<"Case #"<<cnt++<<": ";
            cout<< (int)(n*(log10(2) ) )<<endl;
        }
    
    }
    所遇皆星河
  • 相关阅读:
    HSTS详解
    cdnbest 节点和主控连接不上原因主要查看几点
    正则表达式30分钟入门教程
    cdn贝四层协议配置端口映射TCP端口转发
    关于HSTS安全协议的全面详细解析
    cdnbest配置强制ssl跳转
    THUWC2020游记
    2019 CSP-S Day2-T1 Emiya 家今天的饭(DP)
    网络流之费用流(最小费用最大流) 学习笔记
    网络流之最大流 学习笔记
  • 原文地址:https://www.cnblogs.com/Shallow-dream/p/11623517.html
Copyright © 2020-2023  润新知