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/

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

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

  • 相关阅读:
    <<Rust程序设计语言>>个人版(4: 所有权)
    《逻辑学入门》笔记(45-66)
    《逻辑学入门》笔记(23-44)
    <<Rust程序设计语言>>个人版(3.3: 函数/3.4: 注释/3.5: 控制流)
    <<Rust程序设计语言>>个人版(1: 入门/2: 编写猜谜游戏)
    网站如何保护用户的密码
    在 Gin 项目中使用 WebSocket
    《逻辑学入门》笔记(1-22)
    浅谈双重认证逻辑
    某大型网络安全活动中遇到的钓鱼邮件
  • 原文地址:https://www.cnblogs.com/SutsuharaYuki/p/11225353.html
Copyright © 2011-2022 走看看