题目链接:

  http://acm.hdu.edu.cn/showproblem.php?pid=5752

题目大意

  定义f(n)=⌊√n⌋,fy(n)=f(fy-1(n)),求y使得fy(n)=1。如果y>5输出TAT。(n<10100)

题目思路:

  【模拟】

  5层迭代是232,所以特判一下层数是5的,其余开根号做。注意数据有0。

  队友写的。

 #include<stdio.h>
#include<string.h>
#include<math.h>
int main()
{
char st[];
int temp;
int ans;
while(scanf("%s",st)!=EOF)
{
if (st[]=='' || strlen(st)> || strlen(st)== && strcmp(st,"")>)
printf("TAT\n");
else
if (strlen(st)== && strcmp(st,"")>)
printf("5\n");
else
{
ans=;
sscanf(st,"%d",&temp);
while(temp!=)
{
temp=(int)(sqrt(double(temp)));
ans++;
}
if (ans==) ans=;
printf("%d\n",ans);
}
}
return ;
}

【模拟】HDU 5752 Sqrt Bo的更多相关文章

  1. HDU 5752 Sqrt Bo (数论)

    Sqrt Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5752 Description Let's define the function f ...

  2. HDU 5752 Sqrt Bo【枚举,大水题】

    Sqrt Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total S ...

  3. hdu 5752 Sqrt Bo 水题

    Sqrt Bo 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5752 Description Let's define the function f ...

  4. hdu 5752 Sqrt Bo

    Sqrt Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total S ...

  5. HDU 5752 Sqrt Bo (思维题) 2016杭电多校联合第三场

    题目:传送门. 题意:一个很大的数n,最多开5次根号,问开几次根号可以得到1,如果5次还不能得到1就输出TAT. 题解:打表题,x1=1,x2=(x1+1)*(x1+1)-1,以此类推.x5是不超过l ...

  6. HDU 5752

    Sqrt Bo Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Total S ...

  7. 【模拟】HDU 5762 Teacher Bo

    题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5762 题目大意: 给n个点,坐标范围0~m(n,m<=105),求是否存在2个点对满足哈夫曼距 ...

  8. HDU 5761 Rower Bo

    传送门 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 131072/131072 K (Java/Others)Special Jud ...

  9. HDU 5753 Permutation Bo (推导 or 打表找规律)

    Permutation Bo 题目链接: http://acm.hdu.edu.cn/showproblem.php?pid=5753 Description There are two sequen ...

随机推荐

  1. 使用MWC四轴起飞侧翻解决方法

    原因如下:1.电机顺序错了,如上图所示,上面蓝色的箭头是机头,绿色的箭头是电机转向,3.10.11.9对应MWC飞控版上的D3,D9,D11,D9,蓝色箭头对应MWC飞控板的箭头 或者传感器的Y轴 以 ...

  2. c# 用正则表达式获取开始和结束字符串中间的值

    c# 用正则表达式获取开始和结束字符串中间的值 /// <summary> /// 获得字符串中开始和结束字符串中间得值 /// </summary> /// <para ...

  3. cxf webservice异步调用

    http://blog.csdn.net/changpingchen/article/details/9048347 http://www.oschina.net/question/780719_12 ...

  4. Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tableview cell's content view...

    Warning once only: Detected a case where constraints ambiguously suggest a height of zero for a tabl ...

  5. Swift - 33 - 返回函数类型和函数嵌套

    //: Playground - noun: a place where people can play import UIKit /*---------------------------返回函数类 ...

  6. 三、singleton(单例化)一个对象的几种方法

    方案一:私有化构造器,通过static final域 @Test public void test13() { A215 a=A215.a; A215 b=A215.a; System.out.pri ...

  7. html5--canvas学习笔记

    1. 添加<canvas>元素 right: <canvas id="myCanvas" width="300" height="3 ...

  8. 事后调试之MiniDump转储

    程序发布后,针对在用户使用过程中出现的一些问题进行调试,这个过程可以称为是事后调试.在程序Crash时转储MiniDump文件供软件开发工程师分析是一种比较常用的方法.下面介绍两种常用的在程序Cras ...

  9. poj1159 Palindrome

    G - 回文串 Time Limit:3000MS     Memory Limit:65536KB     64bit IO Format:%I64d & %I64u   Descripti ...

  10. DCI

    理论: 某个data,在一个特定的场景中,以某个角色role,来与该场景中的其他角色进行交互.这个过程要以代码的方式表达出来,他要求data本身不具备交互行为, 有交互行为的是角色,当一个data没有 ...