HDU 6182 A Math
A Math Problem
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 389 Accepted Submission(s): 185
Each case only contains a positivse integer n in a line.
1≤n≤1018
#include <iostream>
#include <algorithm>
#include <cstring>
#include <cstdio>
#include <vector>
#include <queue>
#include <stack>
#include <cstdlib>
#include <iomanip>
#include <cmath>
#include <cassert>
#include <ctime>
#include <map>
#include <set>
using namespace std;
#define lowbit(x) (x&(-x))
#define max(x,y) (x>=y?x:y)
#define min(x,y) (x<=y?x:y)
#define MAX 100000000000000000
#define MOD 1000000007
#define pi acos(-1.0)
#define ei exp(1)
#define PI 3.141592653589793238462
#define ios() ios::sync_with_stdio(false)
#define INF 1044266558
#define mem(a) (memset(a,0,sizeof(a)))
typedef long long ll;
const ll M=;
ll n;
ll quick_pow(ll x,ll y)
{
ll ans=;
while(y)
{
if(y&) ans*=x;
x*=x;
y>>=;
}
return ans;
}
int main()
{
while(scanf("%lld",&n)!=EOF)
{
if(n>=M) printf("15\n");
else
{
for(int i=;i<=;i++)
{
if(quick_pow(i,i)<=n && n<quick_pow(i+,i+))
{
printf("%d\n",i);
break;
}
}
}
}
return ;
}
HDU 6182 A Math的更多相关文章
- HDU 6182 A Math Problem
暴力. $k$的$k$次方在$k=15$的时候,达到了最大不爆掉的情况. #include<bits/stdc++.h> using namespace std; long long an ...
- [HDU - 5170GTY's math problem 数的精度类
题目链接:HDU - 5170GTY's math problem 题目描述 Description GTY is a GodBull who will get an Au in NOI . To h ...
- hdu 2393:Higher Math(计算几何,水题)
Higher Math Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)Total ...
- hdu 6182
A Math Problem Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)To ...
- 【HDU 5105】Math Problem
题意 f(x)=|ax3+bx2+cx+d| 求f(x)在L≤x≤R的最大值. 分析 参数有可能是0,注意分类讨论 1.当a=0时 b=0,f为一次函数(c≠0)或者常数函数(c=0),最大值点在区间 ...
- HDU 2393 Higher Math
#include <cstdio> #include <string> using namespace std; void swap(int& a,int& b ...
- HDU 2393 Higher Math (判断直角三角形)
题意:给定三个边,判断是不是直角三角形. 析:水题,勾股定理... 代码如下: #include <iostream> #include <cstdio> #include & ...
- @hdu - 6607@ Easy Math Problem
目录 @description@ @solution@ @accepted code@ @details@ @description@ 求: \[\sum_{i=1}^{n}\sum_{j=1}^{n ...
- 2017ACM/ICPC广西邀请赛-重现赛
HDU 6188 Duizi and Shunzi 链接:http://acm.hdu.edu.cn/showproblem.php?pid=6188 思路: 签到题,以前写的. 实现代码: #inc ...
随机推荐
- hdu 3292 No more tricks, Mr Nanguo
No more tricks, Mr Nanguo Time Limit: 3000/1000 MS (Java/Others) Memory Limit: 65535/32768 K (Jav ...
- Linux FTP客户端
1.File Zilla File Zilla是一个开源的,跨平台的Linux FTP客户端.File Zilla有一个标签式的用户界面,允许用户查看正在传输的文件的所有细节.File Zilla是通 ...
- [bzoj4765]普通计算姬(分块+树状数组+DFS序)
题意 给定一棵n个节点的带权树,节点编号为1到n,以root为根,设sum[p]表示以点p为根的这棵子树中所有节点的权值和.计算姬支持下列两种操作: 1 给定两个整数u,v,修改点u的权值为v. 2 ...
- 参考《深度学习之PyTorch实战计算机视觉》PDF
计算机视觉.自然语言处理和语音识别是目前深度学习领域很热门的三大应用方向. 计算机视觉学习,推荐阅读<深度学习之PyTorch实战计算机视觉>.学到人工智能的基础概念及Python 编程技 ...
- linux一个网卡添加多个虚IP
[root@localhost ~]# ifconfig bond0:0 10.0.0.202 netmask 255.255.255.255 broadcast 10.0.0.255 up 摘自:h ...
- caioj 1081 动态规划入门(非常规DP5:观光游览)
这道题和前面的分组的题有点像 就是枚举最后一组的长度. 然后组数可以在第一层循环也可以在第二层循环 我自己的话就统一一下在第一层循环吧 然后这道题题意我一直没理解清楚,浪费了很多时间,写复杂了 同时初 ...
- Java基础学习总结(26)——JNDI入门简介
JNDI是 Java 命名与目录接口(Java Naming and Directory Interface),在J2EE规范中是重要的规范之一,不少专家认为,没有透彻理解JNDI的意义和作用,就没有 ...
- OpenGL 获取当前屏幕坐标对应的三维坐标
转自原文 OpenGL 获取当前屏幕坐标对应的三维坐标,使用很简单glu库中的一个函数 #include <GL/glut.h> #include <stdlib.h> #in ...
- Linux能ping通IP,ping不通域名
今天碰到个问题, 能ping通IP地址, ping不通域名, 一直以为是 DNS解析服务器的问题, 找了半天. 问题不在这里. [root@www postfix]# cat /etc/resolv. ...
- hdu1501 Zipper--DFS
原题链接:pid=1501">http://acm.hdu.edu.cn/showproblem.php?pid=1501 一:原题内容 Problem Description Giv ...