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/

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

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

  • 相关阅读:
    day1-字符串拼接、表达式、break和continue
    ssh免密登录
    1-5 文档的基本 CRUD 与批量操作
    1-4 安装logstash
    1-3 安装cerebro
    1-2 kibana 7.5.1 安装配置
    1-1 elasticsearch7.5 集群搭建 es 7
    生产环境k8s集群搭建
    Gearman任务分布系统部署windows平台_使用Cygwin
    [转载]单元测试之道(使用NUnit)
  • 原文地址:https://www.cnblogs.com/SutsuharaYuki/p/11225353.html
Copyright © 2011-2022 走看看