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. uxpin books

    http://uxpin.com/knowledge.html/?utm_source=Email+Marketing+Automation&utm_campaign=80d94e146a-l ...

  2. poj 2777 Count Color(线段树)

    题目地址:http://poj.org/problem?id=2777 Count Color Time Limit: 1000MS   Memory Limit: 65536K Total Subm ...

  3. Microsoft.Web.Administration in IIS

    http://blogs.msdn.com/b/carlosag/archive/2006/04/17/microsoftwebadministration.aspx 最好使用在IIS8中,因为为每一 ...

  4. 1206: [HNOI2005]虚拟内存 - BZOJ

    Description 操作系统中一种重要的存储管理技术就是虚拟内存技术.操作系统中允许进程同时运行,也就是并行.每个进程都有其相对独立的数据块(进程运行的过程中将对其进行读写操作).理想的情况下,这 ...

  5. Android开发之onClick事件的三种写法(转)

    package a.a; import android.app.Activity; import android.os.Bundle; import android.view.View; import ...

  6. hdu 4665

    转载一下  用的搜索   竟然过了 ............代码 ....... #include<stdio.h> #include<string.h> #include&l ...

  7. hdu 1851 A Simple Game 博弈论

    简单博弈问题(巴什博弈-Bash Game) 巴什博弈:只有一堆n个物品,两个人轮流从这对物品中取物,规定每次至少取一个,最多取m个,最后取光着得胜. 很容易想到当n%(m+1)!=0时,先取者必胜, ...

  8. *[topcoder]GooseTattarrattatDiv1

    http://community.topcoder.com/stat?c=problem_statement&pm=12730&rd=15701 这道题有点意思.首先把字符串变成回文, ...

  9. node.js 异步式I/O 与事件驱动

    Node.js 最大的特点就是异步式 I/O(或者非阻塞 I/O)与事件紧密结合的编程模式.这种模式与传统的同步式 I/O 线性的编程思路有很大的不同,因为控制流很大程度上要靠事件和回调函数来组织,一 ...

  10. IMX515开发备忘

    1.多个PAD可以选择为同样的功能引脚 IMX515处理器一个PAD可以作为多种功能引脚,比如EIM_D25可以作为UART3_RXD,定义如下: 图1 而处理还有一个另一个UART3_RXD的PAD ...