zoukankan      html  css  js  c++  java
  • 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;
        }
    
    }
    所遇皆星河
  • 相关阅读:
    rabbitmq级联之shovel插件和exchange.bind
    gcc常用编译选项
    windows下rabbitmq-c编译(带openssl、无需MinGW)
    windows下openssl编译
    关于actor模型
    mysql优化之使用iotop+pt-ioprofile定位具体top io文件
    centos6下jbd2进程占用大量IO处理
    c++中的header-only library
    java中线程的停止以及LockSupport工具类
    java Condition条件变量的通俗易懂解释、基本使用及注意点
  • 原文地址:https://www.cnblogs.com/Shallow-dream/p/11623517.html
Copyright © 2011-2022 走看看