A Math Problem

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

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

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

1≤n≤1018

 
Output
For each test case, output an integer indicates the number of positive integers k satisfy kk≤n in a line.
 
Sample Input
1
4
 Sample Output
1
2
 水题,打表。
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>=y?x:y)
#define min(x,y) (x<=y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(false)
#define INF 1044266558
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
const ll M=;
ll n;
ll quick_pow(ll x,ll y)
{
ll ans=;
while(y)
{
if(y&) ans*=x;
x*=x;
y>>=;
}
return ans;
}
int main()
{
while(scanf("%lld",&n)!=EOF)
{
if(n>=M) printf("15\n");
else
{
for(int i=;i<=;i++)
{
if(quick_pow(i,i)<=n && n<quick_pow(i+,i+))
{
printf("%d\n",i);
break;
}
}
}
}
return ;
}

HDU 6182 A Math的更多相关文章

  1. HDU 6182 A Math Problem

    暴力. $k$的$k$次方在$k=15$的时候,达到了最大不爆掉的情况. #include<bits/stdc++.h> using namespace std; long long an ...

  2. [HDU - 5170GTY's math problem 数的精度类

    题目链接:HDU - 5170GTY's math problem 题目描述 Description GTY is a GodBull who will get an Au in NOI . To h ...

  3. hdu 2393:Higher Math(计算几何,水题)

    Higher Math Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total ...

  4. hdu 6182

    A Math Problem Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)To ...

  5. 【HDU 5105】Math Problem

    题意 f(x)=|ax3+bx2+cx+d| 求f(x)在L≤x≤R的最大值. 分析 参数有可能是0,注意分类讨论 1.当a=0时 b=0,f为一次函数(c≠0)或者常数函数(c=0),最大值点在区间 ...

  6. HDU 2393 Higher Math

    #include <cstdio> #include <string> using namespace std; void swap(int& a,int& b ...

  7. HDU 2393 Higher Math (判断直角三角形)

    题意:给定三个边,判断是不是直角三角形. 析:水题,勾股定理... 代码如下: #include <iostream> #include <cstdio> #include & ...

  8. @hdu - 6607@ Easy Math Problem

    目录 @description@ @solution@ @accepted code@ @details@ @description@ 求: \[\sum_{i=1}^{n}\sum_{j=1}^{n ...

  9. 2017ACM/ICPC广西邀请赛-重现赛

    HDU 6188 Duizi and Shunzi 链接:http://acm.hdu.edu.cn/showproblem.php?pid=6188 思路: 签到题,以前写的. 实现代码: #inc ...

随机推荐

  1. vuejs v-bind

    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/ ...

  2. tomcat动态查看服务器打印日志

    [root@localhost ~]# cd /usr/local/tomcat/logs [root@localhost logs]# tail -f catalina.out   FROM:htt ...

  3. Highcharts 前端图表插件

    Highcharts 支持将图片下载成各种格式 Highcharts官网:https://www.hcharts.cn/download <div id="container" ...

  4. 前端之CSS选择器

    基本选择器 元素选择器 p {color: "red";} ID选择器 #i1 { background-color: red; } 类选择器 .c1 { font-size: 1 ...

  5. Linux 部署项目经验总结

    [通用命令]  1.创建文件夹 mkdir -p xxx 2.解压包 tar -zxvf xxxx.tar.gz  3.缩文件 tar zcvf 压缩包名称.tar.gz 要压缩的文件  4.动命令  ...

  6. python第三次作业——叶耀宗

    作业1 import random#引入随机数模块xing=["小白","小黄","小王","小陈","小绿& ...

  7. python 任何基础问题,包括语法等

    *)copy()和deep copy() 参考链接:https://blog.csdn.net/qq_32907349/article/details/52190796 *)OPP面向对象编程 *)接 ...

  8. [USACO15JAN]草鉴定Grass Cownoisseur(分层图+tarjan)

    [USACO15JAN]草鉴定Grass Cownoisseur 题目描述 In an effort to better manage the grazing patterns of his cows ...

  9. 18. IDEA 添加 persistence 时没有 sessionFactory

    转自:http://www.voidcn.com/article/p-rryjfhwi-e.html IDEA 添加 persistence 时没有 sessionFactory 点击项目,然后F4 ...

  10. CSS的水平居中和垂直居中解决方案

    在写CSS样式的时候,有时为了美观,会添加水平居中和垂直居中,这时候你有可能会遇到很棘手的问题,有些水平居中和垂直居中的属性添加上去完全没反应,下面给大家列举一些CSS水平居中和垂直居中的终极解决方案 ...