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. Ubuntu系统常见问题解决

    我本人使用Ubuntu16.04LTS已经有一段时间了.实话来说,ubuntu虽然确实是开源世界的一款优秀的桌面操作系统,但是易用性和稳定性相比Windows还是差太多.本人从安装系统到逐步配置生产环 ...

  2. 反射 方法和函数 type

    1. isinstance/issubclass/type  *** issubclass 判断xxx类是否是xxx类的子类 class Animal: pass class Cat(Animal): ...

  3. Spring Boot中使用Redis数据库

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

  4. python实现音乐播放器

    python实现音乐播放器 模块:pygame 模块:time Python 布尔循环实例: import time import pygame muxi_k = """ ...

  5. js 正则语法

    原文:一次性搞懂javascript正则表达式之语法 看完原文,对正则中以前一知半解的捕获组与非捕获组.零宽断言有了更深的理解.很感谢原文作者~~ 普通字符 当我们写a的时候,我们指的就是a:当我们写 ...

  6. win下wamp虚拟主机配置

    第一步:在http://www.wampserver.com/网站上下载Wampserver,可以根据计算机的版本(32位或者64位)下载对应的版本 第二步,傻瓜式安装(直接点击下一步,下一步就好). ...

  7. Swift 里 Array (二)初始化

    init() 函数 在 Array 里 public init() { _buffer = _Buffer() } 以Buffer 是 _ContiguousArrayBuffer 为例. 即初始化了 ...

  8. iOS 数据持久化-- FMDB

    一.简介 1.什么是FMDB FMDB是iOS平台的SQLite数据库框架 FMDB以OC的方式封装了SQLite的C语言API 2.FMDB的优点 使用起来更加面向对象,省去了很多麻烦.冗余的C语言 ...

  9. 遗忘Windows Server 2008R2密码的处理方法

    遗忘Windows Server 2008R2的处理方法 有的时候,我们会由于各种原因忘掉了服务器密码,比如服务器太多,太杂什么的,或直接是被人黑掉了,这个时候我们想要登录,发现我们已经没有办法了,其 ...

  10. python高并发?

    参考: https://yunsonbai.top/