A Math Problem

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

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
 

Source

 
 //2017-08-31
#include <cstdio>
#include <cstring>
#include <iostream>
#include <algorithm>
#define ll long long using namespace std; const int N = ;
ll arr[N]; int main()
{
for(ll i = ; i <= ; i++){
arr[i] = ;
for(int j = ; j < i; j++)
arr[i] *= i;
}
ll n;
while(cin>>n){
int ans = ;
for(int i = ; i <= ; i++){
if(arr[i] <= n){
ans++;
}
}
cout<<ans<<endl;
} return ;
}

HUD6182的更多相关文章

随机推荐

  1. 17_python_成员

    一.类成员 1.字段 class Province: country = '中国' # 实例 (静态) 字段:类变量. 不属于对象, 对象可以访问 def __init__(self, name): ...

  2. nginx root&alias 文件路径配置

    nginx 指定文件路径有两种方式 root 和 alias,root 与 alias 主要区别在于 nginx 如何解释 location 后面的 uri,这会使两者分别以不同的方式将请求映射到服务 ...

  3. Spring Boot中使用Redis数据库

    引入依赖 Spring Boot提供的数据访问框架Spring Data Redis基于Jedis.可以通过引入spring-boot-starter-redis来配置依赖关系. <depend ...

  4. 机器学习基石笔记:15 Validation

    一.模型选择问题 如何选择? 视觉上 NO 不是所有资料都能可视化;人脑模型复杂度也得算上. 通过Ein NO 容易过拟合;泛化能力差. 通过Etest NO 能保证好的泛化,不过往往没法提前获得测试 ...

  5. 开发ASP.NET MVC 在线录音录像(音视频录制并上传)

    最近有个在线招聘录音的开发需求,需要在招聘网站上让招聘者上传录音和视频. 找到两个不错的javascript开源,可以在除了IE以外的浏览器运行. https://github.com/mattdia ...

  6. centos7搭建mysql5.7主从同步

    主从基本概念 mysql主从同步定义 主从同步使得数据可以从一个数据库服务器复制到其他服务器上,在复制数据时,一个服务器充当主服务器(master),其余的服务器充当从服务器(slave).因为复制是 ...

  7. 在MySQL Workbench查看表,表结构,索引,函数,存储过程,触发器,重连

    表 表结构 索引 触发器 存储过程 函数 重新连接 出现Error Code: 2006 MySQL server has gone away时

  8. (转)centos 7 Tomcat 8.5 的安装及生产环境的搭建调优

    原文:https://www.cnblogs.com/linhankbl/articles/9149804.html#top JVM菜鸟进阶高手之路七(tomcat调优以及tomcat7.8性能对比) ...

  9. SqlServer 查看被锁的表和解除被锁的表

    查看被锁的表 1 2 select   request_session_id   spid,OBJECT_NAME(resource_associated_entity_id) tableName   ...

  10. Your Mac is infected with (3) Viruses!

    记一次流氓程序的清理 某天我的电脑不幸感染了这么一个病毒