• 2017 Multi-University Training Contest


    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 0 and (2m1)(inclusive).

    As a young man born with ten fingers, he loves the powers of 10 so much, which results in his eccentricity that he always ranges integers he would like to use from 1 to 10k(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 m, your task is to determine maximum possible integer k 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 m, satisfying 1m105.
     
    Output
    For each test case, output "Case #xy" in one line (without quotes), where x indicates the case number starting from 1 and y denotes the answer of corresponding case.
     
    Sample Input
    1
    64
     
    Sample Output
    Case #1: 0
    Case #2: 19
     
    Source

     题意:10^k能表示2^m-1,k有多大

    解法:额..mlog10​​2

     1 #include<bits/stdc++.h>
     2 typedef long long LL;
     3 typedef unsigned long long ULL;
     4 using namespace std;
     5 const int maxn=2e5+10;
     6 int main(){
     7     long long n;
     8     int num=1;
     9     while(cin>>n){
    10         long long pos=(n*log10(2));
    11         printf("Case #%d: ",num++);
    12         cout<<pos<<endl;
    13     }
    14     return 0;
    15 }
  • 相关阅读:
    python-ConfigParser模块【读写配置文件】
    MinGW安装和使用
    mybatis批量操作
    SSM框架的简单搭建
    idea录制宏
    数据导出,导入
    JS中调用android和ios系统手机打开相机并可选择相册功能
    get请求中url传参中文乱码问题
    hibernate criteria中Restrictions的用法
    hibernate报错
  • 原文地址:https://www.cnblogs.com/yinghualuowu/p/7237300.html
Copyright © 2020-2023  润新知