当前位置:网站首页>Fzu1669 right angled triangle
Fzu1669 right angled triangle
2022-07-27 19:36:00 【51CTO】
Topic link :
http://acm.fzu.edu.cn/problem.php?pid=1669
The main idea of the topic :
Be content to a、b It's a right angle side ,c It's a hypotenuse , And satisfy a + b + c <= L The number of right triangle .
Ideas :
Pythagorean theorem ,a、b、c That is, the primitive Pythagorean triple , Then meet :
x = m^2 - n^2
y = 2*m*n
z = m^2 + n^2
among m > n, And if m It's odd , be n For the even , if m For the even , be n It's odd .
enumeration m、n, Then multiply the triple by i times , Guarantee i * (x + y + z) Within the scope given (2 * m^2 + 2 * m*n <= L),
You can find all triples that meet the conditions .
AC Code :
边栏推荐
- Low code implementation exploration (45) business parameters
- S32K系列芯片--简介
- Role authorization --- complete the addition and deletion of secondary menus by adding and deleting primary menus
- kettle学习——8.2版本的资源库配置变为灰色,且没有了Connect按钮
- c语言:12、gdb工具调试c程序
- Cumulative output data of kettle Excel
- 2022 preparation for autumn recruitment 10W word interview sketch PDF version, with operating system and computer network interview questions
- kettle switch / case 控件实现分类处理
- Webmagic+selenium+chromedriver+jdbc垂直抓取数据。
- 来一遍《剑指Offer》03. 数组中重复的数字
猜你喜欢

Daily question (02): inverted string

C language: 8. Makefile preparation

4 轮拿下字节 Offer,面试题复盘

golang设置国内镜像,vscode配置golang开发环境,vscode调试golang代码

Complete source code of E-commerce mall applet project (wechat applet)

kettle switch / case 控件实现分类处理

C language: 12. GDB tool debugging C program

C language: 15. Structure

c语言:15、结构体

Analysis of Eureka server
随机推荐
[Luogu p3175] bitwise OR (min max inclusive) (high-dimensional prefix and / FWT)
Kettle learning - the repository configuration in version 8.2 is grayed out, and there is no connect button
Basic use of Nacos (1) - getting started
嵌入式C语言结构体
C language: 9. Return in main function
c语言:6、指针的简单使用与注意事项
SSM project uses filter to realize login monitoring
C language: 6. Simple use and precautions of pointer
Golang sets the domestic image, vscode configures the golang development environment, and vscode debugs the golang code
HDU1573 X问题【一元线性同余方程组】
To create a MySQL data source resource group, you must choose to create a new exclusive data integration resource group? Or use a common resource group? thank you
win10小技巧(1)——转移桌面位置
S32K系列芯片--简介
What if idea successfully connects to the database without displaying the table
HDU1171_Big Event in HDU【01背包】
kettle 合并记录 数据减少
IPFs obtains the public key and private key through the interface, and encrypts the storage. First bullet
5W奖金池/面向高校,2022法律科技创新大赛报名火热进行中
Memory management A4
kettle入门级操作第一篇(读取excel、输出excel)