当前位置:网站首页>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 :
边栏推荐
- What if idea successfully connects to the database without displaying the table
- sql 时间处理(SQL SERVER\ORACLE)
- IPFs obtains the public key and private key through the interface, and encrypts the storage. First bullet
- Daily question (02): inverted string
- win10小技巧(1)——转移桌面位置
- c语言:10、输入流,输出流,错误流
- Using vscode to build u-boot development environment
- Tab control of MFC advanced control (CTabCtrl)
- Kettle learning - the repository configuration in version 8.2 is grayed out, and there is no connect button
- 搭建阿里云+typora+Picgo图床错误分析
猜你喜欢
随机推荐
Basic use of Nacos (1) - getting started
kettle switch / case 控件实现分类处理
C语言打印菱形
Kettle learning - the repository configuration in version 8.2 is grayed out, and there is no connect button
成本高、落地难、见效慢,开源安全怎么办?
VIVO应用市场APP上架总结
js常用utils封装
mysql学习笔记(1)——变量
The go zero singleton service uses generics to simplify the registration of handler routes
几种无线协议简介
ES6 learning notes (1) - quick start
c语言:clion调试方法
利用 Fastjson json (简单粗暴版)
opds sql 里面可以用set 定义局部变量吗
c语言:11、管道
C language: 10. Input stream, output stream, error stream
MySQL learning notes (2) -- stored procedures and stored functions
Hardware acceleration of zero knowledge proof
kettle入门级操作第一篇(读取excel、输出excel)
Opening and using Alibaba cloud object storage OSS









