题目链接:
ztr loves math
ztr喜欢研究数学,一天,他在思考直角三角形方程组的Lower版,即n=x^{2}-y^{2}n=x2−y2,他想知道,对于给出的n,是否会有正整数解。
有T组数据,第一行为一个正整数T(T<=10^{6})T(T<=106),每一行一个正整数n,n <=10^{18}n<=1018
如果有正整数解,输出TrueTrue,否则输出FalseFalse
4
6
25
81
105
False
True
True
True 题意: 思路: 发现奇数和4的倍数可以满足条件;1和4特判; AC代码:
#include <iostream>
#include <cstdio>
#include <cmath>
#include <cstring>
#include <algorithm>
using namespace std;
typedef long long LL;
const int N=1e5+;
const LL mod=1e9+;
const double PI=acos(-1.0); int main()
{
int t;
scanf("%d",&t);
LL n;
while(t--)
{
scanf("%I64d",&n);
if(n%==&&n!=)printf("True\n");
else if(n%==&&n!=)printf("True\n");
else printf("False\n");
}
return ;
}
hdu-5675 ztr loves math(数学)的更多相关文章
-
HDU 5675 ztr loves math (数学推导)
ztr loves math 题目链接: http://acm.hust.edu.cn/vjudge/contest/123316#problem/A Description ztr loves re ...
-
HDU 5675 ztr loves math
ztr loves math Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Others)To ...
-
hdu 5675 ztr loves math(数学技巧)
Problem Description ztr loves research Math.One day,He thought about the "Lower Edition" o ...
-
HDU 5677 ztr loves substring(Manacher+dp+二进制分解)
题目链接:HDU 5677 ztr loves substring 题意:有n个字符串,任选k个回文子串,问其长度之和能否等于L. 题解:用manacher算法求出所有回文子串的长度,并记录各长度回文 ...
-
HDU 5677 ztr loves substring(回文串加多重背包)
ztr loves substring Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/Othe ...
-
HDU 5676 ztr loves lucky numbers (模拟)
ztr loves lucky numbers 题目链接: http://acm.hust.edu.cn/vjudge/contest/121332#problem/I Description ztr ...
-
hdu 5676 ztr loves lucky numbers(dfs+离线)
Problem Description ztr loves lucky numbers. Everybody knows that positive integers are lucky if the ...
-
hdu 5676 ztr loves lucky numbers 打表+二分
ztr loves lucky numbers Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/ ...
-
HDU 5646 DZY Loves Partition 数学 二分
DZY Loves Partition 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5646 Description DZY loves parti ...
随机推荐
-
JAVA加密算法系列-DESCoder
package ***; import java.security.Key; import java.security.SecureRandom; import javax.crypto.Cipher ...
-
python基础之字典dict和集合set
作者:tongqingliu 转载请注明出处:http://www.cnblogs.com/liutongqing/p/7043642.html python基础之字典dict和集合set 字典dic ...
-
React周末特训班
Document #react819_content a { text-decoration: none; color: #ef7b2e; border-bottom: 1px solid #ef7b ...
-
JAVA实现Word(doc)文件读写
1.pom.xml依赖 <dependencies> <dependency> <groupId>org.apache.poi</groupId> &l ...
-
Learning C# by Developing Games with Unity 5.x(2nd) 学习
项目:https://pan.baidu.com/s/1o7IMcZo using UnityEngine; using System.Collections; namespace VoidGame ...
-
【Java】生成UUID
import java.util.UUID; public class MainProcess { public static void main(String[] args) { UUID uuid ...
-
Famous框架系列一:famous/core/Surface
famous/core/Surface 既然是Famous的第一篇文章,就先给Famous打个广告:http://periodic.famo.us Famous12年的作品,点击右下角Fun thi ...
-
Java前期(静态)绑定和后期(动态)绑定
Java前期(静态)绑定和后期(动态)绑定 程序绑定的概念:绑定指的是一个方法的调用与方法所在的类(方法主体)关联起来.对java来说,绑定分为静态绑定和动态绑定:或者叫做前期绑定和后期绑定. 静态绑 ...
-
G - Game HDU - 5242 (数链剖分)
题目链接: G - Game HDU - 5242 题目大意:首先是T组测试样例,给出一颗以1节点为根的树,每个节点有各自的价值,有m次从根节点出发向下走到叶子节点的机会,每次会得到所有经过节点的权值 ...
-
[Arc074E] RGB Sequence
[Arc074E] RGB Sequence Description 今天也在愉快地玩Minecraft!现在MM有一块1?N的空地,每个格子按照顺序标记为1到N.MM想要在这块空地上铺上红石块.绿宝 ...