zoukankan      html  css  js  c++  java
  • A Math Problem

    A Math Problem

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)
    Total Submission(s): 237    Accepted Submission(s): 117


    Problem Description
    You are given a positive integer n, please count how many positive integers k satisfy kkn.
     
    Input
    There are no more than 50 test cases.

    Each case only contains a positivse integer n in a line.

    1n1018
     
    Output
    For each test case, output an integer indicates the number of positive integers k satisfy kkn in a line.
     
    Sample Input
    1 4
     
    Sample Output
    1 2
     
    直接打表从1打到15
     1 #include <bits/stdc++.h>
     2 #define ll long long int
     3 using namespace std;
     4 ll k[15]={1,4,27,256,3125,46656,823543,16777216,387420489,10000000000,
     5 285311670611,8916100448256,302875106592253,11112006825558016,437893890380859375};
     6 int main(){
     7   ll n;
     8   while(cin>>n){
     9     for(int i=14;i>=0;i--){
    10       if(n>=k[i]){
    11         cout<<i+1<<endl;
    12         break;
    13       }
    14     }
    15   }
    16   return 0;
    17 }
     
  • 相关阅读:
    HOW TO MAKE IT FLOW ?
    ansys14.0 从入门到精通
    ansys 14.0
    C++ GUI Qt4 编程 (第二版)
    零基础学QT编程
    医学成像与医学图像处理
    曾巩传
    c++ 编程调试秘笈
    matlab实用教程
    不要重复发明轮子-C++STL
  • 原文地址:https://www.cnblogs.com/zllwxm123/p/7460775.html
Copyright © 2011-2022 走看看