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. 微信小程序导出当前画布指定区域的内容并生成图片保存到本地相册(canvas)

    最近在学小程序,在把当前画布指定区域的内容导出并生成图片保存到本地这个知识点上踩坑了. 这里用到的方法是: wx.canvasToTempFilePath(),该方法作用是把当前画布指定区域的内容导出 ...

  2. 题解 P2146 【[NOI2015]软件包管理器】

    题目大意 ​ 给你一棵树, 求一点到根的路径上有多少个未标记点并全标记, 和询问一个点的子树内有多少已标记点和撤销标记 解题方法 1: install 操作 ​ 这个操作是求一点到根的路径上有多少个未 ...

  3. odoo开发笔记-tree列表视图拖拽排序

    odoo列表tree视图 拖拽排序 实现效果: 实现方式: 模型中定义字段: class CusYourModel(models.Model): """ 你的模型 &qu ...

  4. (转)X-Frame-Options响应头缺失漏洞

    原文:https://blog.csdn.net/ljl890705/article/details/78071601 x-frame-options响应头缺失漏洞. 故名思意,就是返回的响应头信息中 ...

  5. WebStorm project 打开多个项目的方法

    File ---> Setting ---> Project:xxx ---> Sirectories 点击右侧  + Add content root,选择目录后即可显示该项目. ...

  6. c++实现二叉树层序、前序创建二叉树,递归非递归实现二叉树遍历

    #include <iostream> #include <cstdio> #include <stdio.h> #include <string> # ...

  7. sqlserver暂时禁用触发器进行update

    --1.禁用某个表上的所有触发器 ALTER TABLE tbname DISABLE TRIGGER all go --2.执行update语句 update tbname set .... go ...

  8. 浏览器中F5和CTRL F5的行为区别及如何强制更新资源

    一.浏览器中F5和CTRL F5的行为区别 我们直接来看效果,下面是我打开qq网页,分别使用F5和CTRL F5,我们来看区别. F5: CTRL F5: 区别: 首先直观上的区别是CTRL F5明显 ...

  9. Javac中对import关键字进行的处理

    参考文章: (1)关于类的符号输入过程第二篇 ImportScope中存储的为ImportEntry,继承了Scope.Entry类并且多定义了个origin属性,也就是符号的最终来源.除此之外还对g ...

  10. Shell脚本 | 一键获取安卓应用活动名

    上篇文章提到,启动时间的计算需要用到应用启动页的活动名(Activity_Name). 如何获取活动名呢?通常有如下几种方式: 1.询问 Dev 同事 2.adb logcat ActivityMan ...