【2017广西邀请赛】hdu 6182 A Math Problem
来源:互联网 发布:数据背后的惊人差异 编辑:程序博客网 时间:2024/04/29 06:31
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
Each case only contains a positivse integer n in a line.
Output
For each test case, output an integer indicates the number of positive integers k satisfy kk≤n in a line.
Sample Input
14
Sample Output
12
暴力枚举
//// main.cpp// A//// Created by zc on 2017/9/6.// Copyright © 2017年 zc. All rights reserved.//#include <iostream>#include<cstdio>#include<cstring>#include<cmath>#define ll long long using namespace std;ll n;int main(int argc, const char * argv[]) { while(~scanf("%lld",&n)) { int ans=0; for(int i=1;i<=15;i++) { ll sum=1; for(int j=1;j<=i;j++) { sum*=(ll)i; } if(sum<=n) ans++; else break; } printf("%d\n",ans); }}
阅读全文
0 0
- HDU 6182 && 2017广西邀请赛:A Math Problem
- hdu 6182A Math Problem/2017ACM/ICPC广西邀请赛
- 【2017广西邀请赛】hdu 6182 A Math Problem
- A Math Problem ——2017ACM/ICPC广西邀请赛
- A Math Problem (广西邀请赛-重现赛)
- 2017广西邀请赛/hdu
- 广西2017邀请赛 Problem E CS Course
- HDU 6182 A Math Problem
- HDU 6182A Math Problem
- HDU 6186 && 2017广西邀请赛:CS Course
- 【2017广西邀请赛】hdu 6186 CS Course
- 2017 icpc广西邀请赛 K.Query on A Tree (hdu 6191)可持久化字典树
- HDU 6191 && 2017广西邀请赛:Query on A Tree(字典树启发式合并)
- 2017 广西邀请赛&& hdu 6191 Query on A Tree(字典树启发式合并)
- A Math Problem HDU
- HDU 6188 && 2017广西邀请赛:Duizi and Shunzi
- HDU 6185 && 2017广西邀请赛:Covering(矩阵快速幂)
- HDU 6184 && 2017广西邀请赛:Counting Stars(三元环)
- 安装SVN服务器和myeclipse安装svn插件的方式之一
- python 数据如何导入
- itemlistview多条目加载
- angular前后台通讯-笔记(1)
- MATLAB求解函数的零点+代码演示
- 【2017广西邀请赛】hdu 6182 A Math Problem
- CaoHaha's staff(规律,2017中国大学生程序设计竞赛
- eclipse创建虚拟机失败(JDK安装良好的的情况下)
- Universal Link 前端部署采坑记
- 带着你一步一步在Kotlin使用注解,让你不再害怕注解
- moreitemlistviewdemo
- java EE技术体系——CLF平台API开发注意事项(4)——API生命周期治理简单说明
- 在kubernetes 集群上运行分布式tensorflow训练
- jQueryday03(css 层级选择 过滤选择)