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. Asp.net之LINQ入门视频教程

    当前位置: 主页 > 编程开发 > Asp.net视频教程 > Asp.net之LINQ入门视频教程 > http://www.xin1234.com/Program/Aspn ...

  2. mac使用wget下载网站(仿站)

    wget -c -r -np -k -L -p http://www.xxxx.com 参考 wget的安装 http://blog.csdn.net/ssihc0/article/details/7 ...

  3. python学习笔记14(多态、封装、继承)

    创建自已的对象(尤其是类型或者被称为类的对象)是python非常核心的概念. 多态: 可对不同类的对象使用同样的操作. 封装:对外部世界隐藏对象的工作细节. 继承:以普通的类为基础建立专门的类对象. ...

  4. 盒模型------CSS

    盒子的内心世界 1.模型 通过CSS的眼睛 在CSS看来,HTML的所有元素都被看成了盒子:段落,标题,块引用,列表,列表项等.甚至内联元素. 盒子的组成 内容区(content):包含内容(文本或图 ...

  5. 自定义Angular指令与jQuery实现的Bootstrap风格数据双向绑定的单选&多选下拉框

    先说点闲话,熟悉Angular的猿们会喜欢这个插件的. 00.本末倒置 不得不承认我是一个喜欢本末倒置的人,学生时代就喜欢先把晚交的作业先做,留着马上就要交的作业不做,然后慢悠悠做完不重要的作业,卧槽 ...

  6. VB断点大全

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

  7. properties配置文件中文乱码解决方法

    方法1   properties文件的格式一般为: ROOT=http://localhost:8080/BNCAR2/ ROOTPATH=E:/ws2/BNCAR2/rel/ MALL_PARTS_ ...

  8. python中unicode、utf8、gbk等编码问题

    转自:http://luchanghong.com/python/2012/07/06/python-encoding-with-unicode-and-gbk-and-utf8.html 概要:编码 ...

  9. IText 生成横向的doc文档

    IText生成doc文档需要三个包:iTextAsian.jar,iText-rtf-2.1.4.jar,iText-2.1.4.jar 亲测无误,代码如下: import com.lowagie.t ...

  10. 13. 求链表倒数第k个节点

    题目:输入1个链表,输出该链表倒数第k个节点,有头指针和尾指针.链表倒数第0个节点是链表的尾指针节点. 代码: /* 尾指针是倒数第0个,则倒数第k个是正数第len-k个,计算len */ #incl ...