当前位置:网站首页>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
边栏推荐
- Pytorch register_ Hook (operate on gradient grad)
- Common bit operation skills of C speech
- [技术发展-26]:新型信息与通信网络的数据安全
- Unified blog writing environment
- The steering wheel can be turned for one and a half turns. Is there any difference between it and two turns
- Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
- Chinese natural language processing, medical, legal and other public data sets, sorting and sharing
- [機緣參悟-38]:鬼穀子-第五飛箝篇 - 警示之一:有一種殺稱為“捧殺”
- Write a thread pool by hand, and take you to learn the implementation principle of ThreadPoolExecutor thread pool
- Last week's hot review (2.7-2.13)
猜你喜欢
Mysql database | build master-slave instances of mysql-8.0 or above based on docker
One plus six brushes into Kali nethunter
Official announcement! The third cloud native programming challenge is officially launched!
The perfect car for successful people: BMW X7! Superior performance, excellent comfort and safety
Prometheus monitors the correct posture of redis cluster
Grub 2.12 will be released this year to continue to improve boot security
Go RPC call
Naacl 2021 | contrastive learning sweeping text clustering task
Win: use shadow mode to view the Desktop Session of a remote user
STM32 series - serial port UART software pin internal pull-up or external resistance pull-up - cause problem search
随机推荐
Stored procedure and stored function in Oracle
One plus six brushes into Kali nethunter
I use these six code comparison tools
Numpy library introductory tutorial: basic knowledge summary
Exploration and practice of integration of streaming and wholesale in jd.com
runc hang 导致 Kubernetes 节点 NotReady
He was laid off.. 39 year old Ali P9, saved 150million
Visual studio 2019 set transparent background (fool teaching)
PHP Joseph Ring problem
Three properties that a good homomorphic encryption should satisfy
Using druid to connect to MySQL database reports the wrong type
Unified blog writing environment
Interesting practice of robot programming 15- autoavoidobstacles
Pytorch register_ Hook (operate on gradient grad)
Outlook: always prompt for user password
[機緣參悟-38]:鬼穀子-第五飛箝篇 - 警示之一:有一種殺稱為“捧殺”
RichView TRVUnits 图像显示单位
Win: use PowerShell to check the strength of wireless signal
Process scheduling and termination
Collection of gmat750 wrong questions