首页 > 其他 > 详细

A Math Problem

时间:2017-08-31 23:05:04      阅读:579      评论:0      收藏:0      [点我收藏+]

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 }

 

 

A Math Problem

原文:http://www.cnblogs.com/zllwxm123/p/7460775.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!