当前位置:网站首页>Blue bridge - maximum common divisor and minimum common multiple
Blue bridge - maximum common divisor and minimum common multiple
2022-07-05 02:14:00 【uiut】
Enter two positive integers x0,y0(2<=x0<=100000,2<=y0<=100000), Find out... That satisfies the following conditions P,Q The number of
Conditions : 1.P,Q It's a positive integer.
2. requirement P,Q With x0 For the greatest common divisor , With y0 Is the minimum common multiple .
Try to ask for : The number of all possible two positive integers that satisfy the condition .
A problem that goes the other way , It is required to get all possible results from the known common divisors and common multiples
Easy to think from 1 Start the nested loop to get the maximum common divisor and the minimum common multiple of each two numbers , And expected to judge , If it passes, output
It can be slightly optimized
The first screening
First preset two one-dimensional arrays , The first divisor used to store the common factor within the bounds , The second factor used to store the common divisor , Through cyclic comparison , Filter out the numbers that appear in both arrays at the same time
The second screening
from 2 Start the cycle , The minimum common divisor that fails to reach the reservation has been eliminated
————————————————————————————————
I don't know the specific two numbers and there are errors , Think about revising
边栏推荐
- 172. Zero after factorial
- 线上故障突突突?如何紧急诊断、排查与恢复
- 官宣!第三届云原生编程挑战赛正式启动!
- How to make a cool ink screen electronic clock?
- Unpool(nn.MaxUnpool2d)
- batchnorm. Py this file single GPU operation error solution
- Pytorch fine tuning (Fortune): hollowed out design or cheating
- PowerShell: use PowerShell behind the proxy server
- R language uses logistic regression and afrima, ARIMA time series models to predict world population
- [download white paper] does your customer relationship management (CRM) really "manage" customers?
猜你喜欢

Grub 2.12 will be released this year to continue to improve boot security

Exploration and Practice of Stream Batch Integration in JD

Win: use PowerShell to check the strength of wireless signal

Yyds dry inventory swagger positioning problem ⽅ formula

Action News

A label making navigation bar

如何做一个炫酷的墨水屏电子钟?

"C zero foundation introduction hundred knowledge and hundred cases" (72) multi wave entrustment -- Mom shouted for dinner

Lsblk command - check the disk of the system. I don't often use this command, but it's still very easy to use. Onion duck, like, collect, pay attention, wait for your arrival!

MySQL backup and recovery + experiment
随机推荐
Interesting practice of robot programming 14 robot 3D simulation (gazebo+turtlebot3)
[understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
[technology development-26]: data security of new information and communication networks
Win:使用 Shadow Mode 查看远程用户的桌面会话
Talk about the things that must be paid attention to when interviewing programmers
batchnorm. Py this file single GPU operation error solution
Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
Unpool(nn.MaxUnpool2d)
Introduce reflow & repaint, and how to optimize it?
Flutter 2.10 update details
Erreur de type de datagramme MySQL en utilisant Druid
Learn tla+ (XII) -- functions through examples
Es uses collapsebuilder to de duplicate and return only a certain field
The steering wheel can be turned for one and a half turns. Is there any difference between it and two turns
JVM's responsibility - load and run bytecode
MATLB | multi micro grid and distributed energy trading
STL container
. Net starts again happy 20th birthday
Valentine's Day flirting with girls to force a small way, one can learn
Serious bugs with lifted/nullable conversions from int, allowing conversion from decimal