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. SVN 提交必填备注Commit

    操作方法:在SVN的Repositories下,找到要配置的项目,在项目目录下找到hooks文件夹,在其下创建pre-commit.bat文件,把下面复制进去就可以了(无需重启,如果改动,保存bat文 ...

  2. 【BZOJ2428】[HAOI2006]均分数据

    Description 已知N个正整数:A1.A2.…….An .今要将它们分成M组,使得各组数据的数值和最平均,即各组的均方差最小.均方差公式如下: ,其中σ为均方差,是各组数据和的平均值,xi为第 ...

  3. Svg 画图(电池)

    公司现在在做充电桩项目,其中要显示充电桩的电池充电情况,功能展示的时候要画图,之前做的时候准备使用HightChar来画,但是,hightchar好像没有这样的电池图形,最后,项目经理要我自己通过sv ...

  4. 1196: [HNOI2006]公路修建问题 - BZOJ

    Description OI island是一个非常漂亮的岛屿,自开发以来,到这儿来旅游的人很多.然而,由于该岛屿刚刚开发不久,所以那里的交通情况还是很糟糕.所以,OIER Association组织 ...

  5. html5 Doctor——教你规范使用html5标签

    学习地址(英文资料):http://html5doctor.com/ http://www.w3.org/html/wg/drafts/html/master/text-level-semantics ...

  6. 深入了解nagios的各配置文件

    转自http://wolfword.blog.51cto.com/4892126/1220209   对每个配置文件进行讲解,深入理解nagios,好好学习,天天向上~ (1)templates.cf ...

  7. POJ3297+map字符串处理

    简单的字符串处理题. 要注意细节! 附数据两组: ABCC abc ae AAA abc AAAA abc A a B a C a /* */ #include<stdio.h> #inc ...

  8. android 在一个scrollView里面嵌套一个需要滑动的控件(listView、gridView)

    package cn.via.dageeeOrderFood.widget; import android.content.Context; import android.graphics.Point ...

  9. nginx静态资源分离部署

    修改nginx.conf文件,用于nginx处理静态资源. 主要配置如下(在server配置中加入location配置即可): server { listen 80; server_name 123. ...

  10. ArcGIS学习记录—dbf shp shx sbn sbx mdb adf等类型的文件的解释

    原文地址: ArcGIS问题:dbf shp shx sbn sbx mdb adf等类型的文件的解释 - Silent Dawn的日志 - 网易博客 http://gisman.blog.163.c ...