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. 使用Samba实现文件共享

    1987年,微软公司和英特尔公司,共同制定了SMB(Server Messages Block 服务消息块)协议,指在解决局域网内的文件或打印机等资源的共享问题,这也使得在多个主机之间共享文件变得越来 ...

  2. C++ 设置Java 环境变量完整的例子

    #include <stdio.h> #include <stdlib.h> #include <windows.h> #include <iostream& ...

  3. MySQL 5.6不删空用户的影响

    目录 MySQL 5.6不删空用户的影响 问题 分析 测试 启动mysqld时没有加上--skip-name-resolve 启动mysqld时加上--skip-name-resolve 结论 MyS ...

  4. Linux - APT包管理

    dpkg与apt dpkg用来安装本地deb格式软件包,但不会解决软件包的依赖关系. APT(Advanced Packaging Tool)是从更新源获取并安装软件包,而且会解决依赖关系, 但不会安 ...

  5. MySQL查询50例

    创建表和关系 /* 创建表 */ /*年级表*/ DROP TABLE IF EXISTS `class_grade`; CREATE TABLE `class_grade` ( `gid` int( ...

  6. 从用户浏览器输入url到用户看到页面结果的过程,发生了什么事情?

    1.域名解析 域名解析的过程:  1).查询浏览器自身DNS缓存 2).若上面没有查找到,则搜索操作系统自身的dns缓存 3).若上面没有找到,则尝试读取hosts文件 4).若上面没有找到,向本地配 ...

  7. python中文画图显示乱码解决办法

    最近使用notebook Python中的matplotlib作图,发现中文设置的坐标标签和title都显示为乱码,用了网上的许多教程都不管用,嘴后解决的方式是设置下述的两行即可搞定: plt.rcP ...

  8. Ruby:Nokogiri

    阅读推荐: Nokogiri的用法我推荐三篇非常给力的文章: http://ruby.bastardsbook.com/chapters/html-parsing/ http://ruby.basta ...

  9. SSDT Hook实现内核级的进程保护

    目录 SSDT Hook效果图 SSDT简介 SSDT结构 SSDT HOOK原理 Hook前准备 如何获得SSDT中函数的地址呢 SSDT Hook流程 SSDT Hook实现进程保护 Ring3与 ...

  10. ubuntu图形化配置

    安装图形界面 apt-get install ubuntu-desktop 配置用户目录 udo useradd -s /bin/bash -d /home/wykeinstein -m wykein ...