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 ...
最新文章
- 随机森林OOB score作用
- c编写程序完成m名旅客和n辆汽车的同步程序代写
- SQL:给查询添加一个合计行
- E-MapReduce结合DataV进行数据展现
- js数组中的find、filter、sort
- 人工智能AI实战100讲(二)-自动驾驶传感器之激光雷达(三)主流车厂激光雷达的选择及布局
- 线性结构常规操作(四)
- EXCEL数据导入dataset
- ARP 地址解析协议
- tis红石生存服务器后勤系统,我的世界红石生存服务器TIS,真正的大神团队,惊叹世界的杰作...
- c语言算星期,计算任何一天是星期几的C语言源代码.
- HSRP协议详解:配置HSRP实现网关的冗余备份
- 世界500强面试题----反应能力
- php 加号转义,URL中加号(+)转义问题
- 查看表内容 mysql_mysql查询表内容
- 怎么查看电脑系统的初始安装日期
- android p 荣耀v10,荣耀V10和V9哪个好 区别对比分析告诉你
- 小朋友排队(树状数组)
- 开blog记录,咩哈哈
- cascade rcnn:delving into high quality object detection