hdu-5675 ztr loves math(数学)

时间:2021-12-06 12:34:23

题目链接:

ztr loves math

 Time Limit: 2000/1000 MS (Java/Others)
 Memory Limit: 65536/65536 K (Java/Others)
问题描述
ztr喜欢研究数学,一天,他在思考直角三角形方程组的Lower版,即n=x^{2}-y^{2}n=x​2​​−y​2​​,他想知道,对于给出的n,是否会有正整数解。
输入描述
有T组数据,第一行为一个正整数T(T<=10^{6})T(T<=10​6​​),每一行一个正整数n,n <=10^{18}n<=10​18​​
输出描述
如果有正整数解,输出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(数学)的更多相关文章

  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

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

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

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

  4. HDU 5677 ztr loves substring(Manacher&plus;dp&plus;二进制分解)

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

  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&plus;离线)

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

  8. hdu 5676 ztr loves lucky numbers 打表&plus;二分

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

  9. HDU 5646 DZY Loves Partition 数学 二分

    DZY Loves Partition 题目连接: http://acm.hdu.edu.cn/showproblem.php?pid=5646 Description DZY loves parti ...

随机推荐

  1. JAVA加密算法系列-DESCoder

    package ***; import java.security.Key; import java.security.SecureRandom; import javax.crypto.Cipher ...

  2. python基础之字典dict和集合set

    作者:tongqingliu 转载请注明出处:http://www.cnblogs.com/liutongqing/p/7043642.html python基础之字典dict和集合set 字典dic ...

  3. React周末特训班

    Document #react819_content a { text-decoration: none; color: #ef7b2e; border-bottom: 1px solid #ef7b ...

  4. JAVA实现Word(doc)文件读写

    1.pom.xml依赖 <dependencies> <dependency> <groupId>org.apache.poi</groupId> &l ...

  5. Learning C&num; by Developing Games with Unity 5&period;x&lpar;2nd&rpar; 学习

    项目:https://pan.baidu.com/s/1o7IMcZo using UnityEngine; using System.Collections; namespace VoidGame ...

  6. 【Java】生成UUID

    import java.util.UUID; public class MainProcess { public static void main(String[] args) { UUID uuid ...

  7. Famous框架系列一&colon;famous&sol;core&sol;Surface

    famous/core/Surface 既然是Famous的第一篇文章,就先给Famous打个广告:http://periodic.famo.us  Famous12年的作品,点击右下角Fun thi ...

  8. Java前期(静态)绑定和后期(动态)绑定

    Java前期(静态)绑定和后期(动态)绑定 程序绑定的概念:绑定指的是一个方法的调用与方法所在的类(方法主体)关联起来.对java来说,绑定分为静态绑定和动态绑定:或者叫做前期绑定和后期绑定. 静态绑 ...

  9. G - Game HDU - 5242 (数链剖分)

    题目链接: G - Game HDU - 5242 题目大意:首先是T组测试样例,给出一颗以1节点为根的树,每个节点有各自的价值,有m次从根节点出发向下走到叶子节点的机会,每次会得到所有经过节点的权值 ...

  10. &lbrack;Arc074E&rsqb; RGB Sequence

    [Arc074E] RGB Sequence Description 今天也在愉快地玩Minecraft!现在MM有一块1?N的空地,每个格子按照顺序标记为1到N.MM想要在这块空地上铺上红石块.绿宝 ...