Find Integer(费马大定理的使用)
Problem Description people in USSS love math very much, and there is a famous math problem . give you two integers n ,a ,you are required to find 2 integers b ,c such that an +bn=cn . Input one line contains one integer T ;(1≤T≤1000000) next T lines contains two integers n ,a ;(0≤n≤1000 ,000 ,000,3≤a≤40000) Output print two integers b ,c if b ,c exits;(1≤b,c≤1000 ,000 ,000) ; else print two integers -1 -1 instead. Sample Input
1 2 3 Sample Output
4 5 费马大定理在加上勾股数的一些规律: 费马大定理: a^n+b^n=c^n在n>2时是不成立的。 勾股数规律: https://wenku.baidu.com/view/8282f1b669eae009591bec85.html #include <iostream> int main() |
Find Integer(费马大定理的使用)相关推荐
- 【hdu】6441 Find Integer - 费马大定理
Find Integer 题解: 根据费马大定理很容易知道当 n>2 时,等式 a^n+b^n=c^n 是无整数解的. 再假设当 n=0 时,a^0=1.题目中说到 (1≤b,c≤1000,00 ...
- 【HDU - 6441】Find Integer (费马大定理 + 奇偶数列法构造勾股定理)
题干: people in USSS love math very much, and there is a famous math problem . give you two integers n ...
- hdu6441 Find Integer 求勾股数 费马大定理
题目传送门 题目大意: 给出a和n,求满足的b和c. 思路: 数论题目,没什么好说的. 根据费马大定理,当n>2时不存在正整数解. 当n=0或者1时特判一下就可以了,也就是此时变成了一个求勾股数 ...
- HDU 6441 Find Integer 【费马大定理】
传送门:HDU 6441 Find Integer Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/65536 K (Java/O ...
- HDU 6441 Find Integer(费马大定理)
people in USSS love math very much, and there is a famous math problem . give you two integers n,a,y ...
- HDU-6441-Find Integer(费马大定理+勾股数)
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=6441 Problem Description people in USSS love math ver ...
- Find Integer - hdu6441 - 费马大定理+奇偶数列法则
题目来源:http://acm.hdu.edu.cn/showproblem.php?pid=6441 思路: 输入n, 若n>2由费马大定理知无解.输出-1 -1,n=0时也无解,输出-1 - ...
- HDUOJ 6441 Find Integer
HDUOJ 6441 Find Integer 题目链接 Problem Description people in USSS love math very much, and there is a ...
- hdu6441 Find Integer
Problem Description people in USSS love math very much, and there is a famous math problem . give yo ...
最新文章
- Datawhale专访 | 周涛:从窄门进最终走出宽路来
- UniT | Facebook发布全新智能通用Agent!
- SQL Server查询重复数据
- Cadence IC CDB-OA工艺库转换方法
- hbase hbck命令示例
- 怎么使用jstack精确找到异常代码
- 基于Huffman算法的文件解压缩
- mysql插入timeStamp类型数据时间相差8小时的解决办法
- 创建 floating IP - 每天5分钟玩转 OpenStack(106)
- 吴恩达机器学习练习3:Logistic regression(Multi-class Classification)
- asp. net sql网上书店管理系统设计作品
- SpringBoot之kafka安装windows
- VS2017注册之找不到输入key的地方的解决方法
- 良心安利动物 恐龙unity3d模型素材网站
- matlab 仿真 毕业设计,毕业设计matlab仿真
- java操作mysql临时表_MySQL 临时表
- CNT-以太网帧和IEEE802.3帧
- 如何把自家孩子培养成一个顶尖人才(转自微信公众号——紫竹张先生)
- 交换机短路_交换机环路发现及处理
- 投资组合风险收益率公式_投资组合分析的基础收益和亏损