ztr loves math

Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)
Total Submission(s): 896    Accepted Submission(s): 347

Problem Description
ztr loves research Math.One day,He thought about the "Lower Edition" of triangle equation set.Such as n = x2-y2.

He wanted to know that ,for a given number n,is there a positive integer solutions?

 
Input
There are T test cases.
The first line of input contains an positive integer T(T <= 106) indicating the number of test cases.

For each test case:each line contains a positive integer, n <= 1018.

 
Output

If there be a positive integer solutions,print "True", else print "False".

False

 
Sample Input
4
6
25
81
105
 
Sample Output
False
True
True
True

Hint

For the fourth case,$105 = 13^{2}-8^{2}$

 
Source
 
 
 
解析:枚举x和y,得到对应的n,打表找规律。
 
 
 
 #include <cstdio>

 long long n;
int t; int main()
{
scanf("%d",&t);
while(t--){
scanf("%I64d",&n);
if(n == || n == || n% == )
printf("False\n");
else
printf("True\n");
}
return ;
}

HDU 5675 ztr loves math的更多相关文章

  1. HDU 5675 ztr loves math (数学推导)

    ztr loves math 题目链接: http://acm.hust.edu.cn/vjudge/contest/123316#problem/A Description ztr loves re ...

  2. hdu 5675 ztr loves math(数学技巧)

    Problem Description ztr loves research Math.One day,He thought about the "Lower Edition" o ...

  3. HDU 5677 ztr loves substring(Manacher+dp+二进制分解)

    题目链接:HDU 5677 ztr loves substring 题意:有n个字符串,任选k个回文子串,问其长度之和能否等于L. 题解:用manacher算法求出所有回文子串的长度,并记录各长度回文 ...

  4. hdu-5675 ztr loves math(数学)

    题目链接: ztr loves math  Time Limit: 2000/1000 MS (Java/Others)  Memory Limit: 65536/65536 K (Java/Othe ...

  5. HDU 5677 ztr loves substring(回文串加多重背包)

    ztr loves substring Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Othe ...

  6. HDU 5676 ztr loves lucky numbers (模拟)

    ztr loves lucky numbers 题目链接: http://acm.hust.edu.cn/vjudge/contest/121332#problem/I Description ztr ...

  7. hdu 5676 ztr loves lucky numbers(dfs+离线)

    Problem Description ztr loves lucky numbers. Everybody knows that positive integers are lucky if the ...

  8. hdu 5676 ztr loves lucky numbers 打表+二分

    ztr loves lucky numbers Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/ ...

  9. hdu 5677 ztr loves substring 多重背包

    Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total Submission( ...

随机推荐

  1. PDF合并

    要求:将多个table导出到一个PDF里,然后打印. 问题分析:要求将四个table放一个PDF打印,四个table的列各不相同,第一个是表头,其他三个是列表,列比表头多很多,如果直接生成一个exce ...

  2. 【BZOJ 1010】 [HNOI2008]玩具装箱toy

    Description P教授要去看奥运,但是他舍不下他的玩具,于是他决定把所有的玩具运到北京.他使用自己的压缩器进行压缩,其可以将任意物品变成一堆,再放到一种特殊的一维容器中.P教授有编号为1... ...

  3. CQRS学习——一个例子(其六)

    [先上链接:http://pan.baidu.com/s/1o62AHbc ] 多图杀猫 先用一组图看看实现的功能: 添加一个功能 假定现在要添加一个书本录入的功能,那么执行如下的操作: 1.添加Co ...

  4. VB断点大全

    MultiByteToWideChar, ANSI字符串转换成Unicode字符串WideCharToMultiByte, Unicode字符串转换成ANSI字符串 //--------------- ...

  5. LA 4731

    dp[i][j]意思是前i个分成j组最小的花费 #include<cstdio> #include<algorithm> #include<cstring> #in ...

  6. kafka.network.SocketServer分析

    当Kafka启动时,会启动这个SocketServer来接收客户端的连接,处理客户端请求,发送响应. 这个类的注释说明了这个socket server的结构 /** * An NIO socket s ...

  7. unity3d与eclipse集成开发android应用

    原地址:http://blog.csdn.net/armoonwei/article/details/7032537 Unity as a Library Once you have eclipse ...

  8. Visual C++ unicode and utf8 转换

    ATL宏: USES_CONVERSION; W2A A2W CString StringUtil::UTF8_to_UNICODE(const char *utf8_string, int leng ...

  9. iOS开发笔记--宏定义的黑魔法 - 宏菜鸟起飞手册

    宏定义在C系开发中可以说占有举足轻重的作用.底层框架自不必说,为了编译优化和方便,以及跨平台能力,宏被大量使用,可以说底层开发离开define将寸步难行.而在更高层级进行开发时,我们会将更多的重心放在 ...

  10. 玩转redis

    http://www.cnblogs.com/huangxincheng/p/5002794.html