博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
hdu5752——Sqrt Bo(水)
阅读量:2344 次
发布时间:2019-05-10

本文共 1163 字,大约阅读时间需要 3 分钟。

Problem Description

Let’s define the function .

Bo wanted to know the minimum number which satisfies .

note:

It is a pity that Bo can only use 1 unit of time to calculate this function each time.

And Bo is impatient, he cannot stand waiting for longer than 5 units of time.

So Bo wants to know if he can solve this problem in 5 units of time.

Input

This problem has multi test cases(no more than ).

Each test case contains a non-negative integer .

Output

For each test case print a integer - the answer or a string “TAT” - Bo can’t solve this problem.

Sample Input

233
233333333333333333333333333333333333333333333333333333333

Sample Output

3
TAT

超过5次就不行,所以临界值是2^32,就输出TAT。我一开始没把2^32本身算进去,死命WA。。。

#include 
#include
#include
#include
#include
#include
#include
#include
#include
#define INF 0x3f3f3f3f#define MAXN 100010#define mod 1000000007using namespace std;char s[105];int main(){ while(scanf("%s",s)==1) { if(strlen(s)>10) { printf("TAT\n"); continue; } long long num; sscanf(s,"%I64d",&num); if(num==0||num>=4294967296) { printf("TAT\n"); } else { for(long long i=0,e=2;i<=5;e=e*e,++i) { if(num

转载地址:http://kscvb.baihongyu.com/

你可能感兴趣的文章
系统--电脑开机一声长响
查看>>
系统--A disk read error occurred Press Ctrl+Alt+d...
查看>>
系统--把系统BIOS中将光驱设置为第一启动盘
查看>>
Some projects cannot be imported because they a...
查看>>
ubuntu-android--make: *** [out/host/linux-x86/o...
查看>>
原子变量与synchronized详细解释
查看>>
activiti--多实例任务实现会签
查看>>
ie和firefox操作table对象的异同
查看>>
Hadoop 实现定制的Writable类型(附部分源码)
查看>>
一台机器上运行多个ActiveMq
查看>>
java.lang.OutOfMemoryError: PermGen space及其解决方法
查看>>
Nginx配置文件nginx.conf中文详解
查看>>
如何让ajaxfileupload.js支持IE9,IE10,并可以传递多个参数?
查看>>
highcharts扩展tooltip提示异步信息
查看>>
activiti--History 历史配置
查看>>
并行计算框架 Apache Hama
查看>>
eclipse中tomcat启动超时解决办法
查看>>
异质链表
查看>>
debain 安装中文字体
查看>>
activiti MySQLIntegrityConstraintViolationException: Cannot delete or update a parent row
查看>>