A Math Problem

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

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

题意

解析  数据会爆longlong 自己快速幂找到爆点 16爆了

 #include <stdio.h>
#include <math.h>
#include <string.h>
#include <stdlib.h>
#include <iostream>
#include <sstream>
#include <algorithm>
#include <string>
#include <queue>
#include <vector>
using namespace std;
const int maxn= ;
const int inf = 0x3f3f3f3f;
typedef long long ll;
ll n;
ll pow1(ll a,ll b)
{
ll r=,base=a;
while(b)
{
if(b&) r*=base;
base*=base;
b>>=;
}
return r;
}
int main(int argc, char const *argv[])
{
while(scanf("%lld",&n)==)
{
for(int i=;i>=;i--)
{
if(pow1(i,i)<=n)
{
cout<<i<<endl;
break;
} }
}
return ;
}

2017ICPC/广西邀请赛1001(水)HDU6181的更多相关文章

  1. 2017ICPC/广西邀请赛1005(水)HDU6186

    CS Course Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  2. 2017 ICPC 广西邀请赛1004 Covering

    Covering Time Limit: 5000/2500 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total Su ...

  3. 2017ACM/ICPC广西邀请赛-重现赛 1001 A Math Problem

    2017-08-31 16:48:00 writer:pprp 这个题比较容易,我用的是快速幂 写了一次就过了 题目如下: A Math Problem Time Limit: 2000/1000 M ...

  4. hdu 5284 BestCoder Round #48 ($) 1001 水题 *

    题意:看一个字符串中是否包含顺序的  w  y  h ,字符之间可以有其他字符,并且如果有多个连续的vv,则可以看做一个w 比较水,直接看代码 #include<cstdio> #incl ...

  5. HDU 4847 陕西邀请赛A(水)

    HDU 4847 Wow! Such Doge! pid=4847" style="">题目链接 题意:给定文本,求有几个doge,不区分大写和小写 思路:水题.直 ...

  6. 2017 ACM/ICPC 广西邀请赛 题解

    题目链接  Problems HDOJ上的题目顺序可能和现场比赛的题目顺序不一样, 我这里的是按照HDOJ的题目顺序来写的. Problem 1001 签到 #include <bits/std ...

  7. 2017 ICPC 广西邀请赛1005 CS Course

    CS Course Time Limit: 4000/2000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others)Total S ...

  8. 2017ACM/ICPC广西邀请赛-重现赛 1007.Duizi and Shunzi

    Problem Description Nike likes playing cards and makes a problem of it. Now give you n integers, ai( ...

  9. 2017ACM/ICPC广西邀请赛-重现赛 1010.Query on A Tree

    Problem Description Monkey A lives on a tree, he always plays on this tree. One day, monkey A learne ...

随机推荐

  1. Java零碎总结

    获取当前类运行的根目录(即classpath,如bin.classes.AppName等)的方式有: 1.Thread.currentThread().getContextClassLoader(). ...

  2. BZOJ1036 (其实这只是一份板子)

    我说我是不是完蛋了啊... ...昨天考试线段树写错,调了好久才调回来:今天做这道树链剖分辣鸡操作题,TM写错了4个地方!先是建树为了省常数打了一个build结果初值赋错了,然后又是线段树!getma ...

  3. df 命令详解

    一.df  作用:  显示磁盘分区上的可使用的磁盘空间, 默认显示单位为kb . 可以利用该命令来获取硬盘被占用了多少空间,目前还剩下多少空间的等信息. 选项: -a :包含全部的文件系统 -h :以 ...

  4. rpm 命令详解

    参考:http://www.cnblogs.com/xiaochaohuashengmi/archive/2011/10/08/2203153.html rpm是由红帽公司开发的软件包管理方式,使用r ...

  5. Linux(CentOS6.5)修改系统市区被中国标准时间(北京时间)

    本文地址http://comexchan.cnblogs.com/ ,作者Comex Chan,尊重知识产权,转载请注明出处,谢谢! 备份时区配置文件 cp /etc/localtime /etc/l ...

  6. vue2.0的瀑布流组件-使用说明

    做一个小项目,需要瀑布流,就选他了,先看看效果 使用瀑布流布局组件:vue-waterfall-easy 下载引入: 方式一:直接从git上复制组件的完整代码,引入vue组件文件即可 import v ...

  7. 中文代码示例之Vuejs入门教程(一)

    原址: https://zhuanlan.zhihu.com/p/30917346 为了检验中文命名在主流框架中的支持程度, 在vuejs官方入门教程第一部分的示例代码中尽量使用了中文命名. 所有演示 ...

  8. Life in Changsha College-第一次冲刺

    第一次冲刺任务 基于大局的全面性功能框架定位,要求能实现用户基于自己的需求进行的一系列操作. 用户故事 用户打开"生活在长大"的界面 程序首页展示校园服务,论坛等相关信息 用户选择 ...

  9. APP网络测试要点和弱网模拟

    当前APP网络环境比较复杂,网络制式有2G.3G.4G网络,还有越来越多的公共Wi-Fi.不同的网络环境和网络制式的差异,都会对用户使用app造成一定影响.另外,当前app使用场景多变,如进地铁.上公 ...

  10. Android 获取唯一标识替代方法

    private static String getTheOnlyID() { String onlyOne; //获取IMEI TelephonyManager TelephonyMgr = (Tel ...