2017ACM/ICPC广西邀请赛 A Math Problem

解法:发现。。最多15个,那么。。暴力一下啦

 1 #include <iostream>
 2 #include <stdio.h>
 3 #include <vector>
 4 #include <string.h>
 5 #include <map>
 6 using namespace std;
 7 struct Node{
 8     int x,y;
 9 }node[123];
10 map<int,int>Mp;
11 long long n;
12 map<int,int>::iterator it;
13 int main(){
14     while(~scanf("%lld",&n)){
15         int sum=0;
16         for(int i=1;i<=20;i++){
17             long long x=1;
18             for(int j=1;j<=i;j++){
19                 x*=i;
20                 if(x>=1e18+1){
21                 break;
22                 }
23             }
24             if(x<=n){
25                 sum++;
26             }
27         }
28         cout<<sum<<endl;
29     }
30     return 0;
31 }
原文地址:https://www.cnblogs.com/yinghualuowu/p/7458657.html