zoukankan      html  css  js  c++  java
  • HDU 6033 Add More Zero

    Add More Zero
    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)
    Total Submission(s): 663    Accepted Submission(s): 463


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

    Nowadays, he is preparing a thought-provoking problem on a specific type of supercomputer which has ability to support calculations of integers between  and  (inclusive).

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

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

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

    Input
    The input contains multiple test cases. Each test case in one line contains only one positive integer , satisfying .
     

    Output
    For each test case, output "Case #: " in one line (without quotes), where  indicates the case number starting from  and  denotes the answer of corresponding case.
     

    Sample Input
    1 64
     

    Sample Output
    Case #1: 0 Case #2: 19
     

    Source
    2017 Multi-University Training Contest - Team 1
     

    题意:问2的n次方有多少位

    代码

    #include <bits/stdc++.h>
    #include <iostream>
    #include <cstring>
    #include <stack>
    #include <cstdlib>
    #include <queue>
    #include <cmath>
    #include <cstdio>
    #include <algorithm>
    #include <string>
    #include <vector>
    #include <list>
    #include <iterator>
    #include <set>
    #include <map>
    #include <utility>
    #include <iomanip>
    #include <ctime>
    #include <sstream>
    #include <bitset>
    #include <deque>
    #include <limits>
    #include <numeric>
    #include <functional>
    
    #define gc getchar()
    #define mem(a) memset(a,0,sizeof(a))
    #define mod 1000000007
    #define sort(a,n,int) sort(a,a+n,less<int>())
    #define fread() freopen("in.in","r",stdin)
    #define fwrite() freopen("out.out","w",stdout)
    using namespace std;
    
    typedef long long ll;
    typedef char ch;
    typedef double db;
    
    const int maxn=1e5+10;
    
    int main()
    {
        ll m , n , x;
        m = 0;
        while(cin >> n)
        {
            m++;
            x = int( n*log10(2) );
            cout << "Case #" << m << ": " << x << endl;
        }
        return 0;
    }

    作者:YukiRinLL

    出处:YukiRinLL的博客--https://www.cnblogs.com/SutsuharaYuki/

    您的支持是对博主最大的鼓励,感谢您的认真阅读。

    本文版权归作者所有,欢迎转载,但请保留该声明。

  • 相关阅读:
    SSL和SSH的差别
    cocos2d-x 3.0游戏实例学习笔记 《跑酷》 第五步--button控制主角Jump&amp;Crouch
    UVA
    程序员,你们这么拼是找不到妹纸的!
    组件:表行组件
    表单修饰符.lazy.number.trim
    表单下拉框select
    表单单选按钮input[type="radio"]
    表单复选框input[type="checkbox"]
    表单控件绑定v-model
  • 原文地址:https://www.cnblogs.com/SutsuharaYuki/p/11225353.html
Copyright © 2011-2022 走看看