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;
        }
    
    }
    所遇皆星河
  • 相关阅读:
    va_start/va_arg/va_end原理与使用
    一民工在火车上的遭遇(笑过后全是泪水)
    Introduce to ArcSDE
    浅谈优化空间数据库的几种方案
    ArcSDE安装全攻略(来源:GIS空间站 作者:陈元琳)
    arcsde sqlserver数据库的移植
    arcims开发经验总结(4) (arcIMS 客户端 连接器的选择)
    ArcSDE 8.1中空间数据的备份与恢复
    安装ArcSDE9 For Sqlserver的过程
    arcims开发经验总结(3) (杂谈1)
  • 原文地址:https://www.cnblogs.com/Shallow-dream/p/11623517.html
Copyright © 2011-2022 走看看