当前位置:网站首页>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
边栏推荐
- [understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
- JVM - when multiple threads initialize the same class, only one thread is allowed to initialize
- Leetcode takes out the least number of magic beans
- Interesting practice of robot programming 14 robot 3D simulation (gazebo+turtlebot3)
- Naacl 2021 | contrastive learning sweeping text clustering task
- The steering wheel can be turned for one and a half turns. Is there any difference between it and two turns
- 【附源码】基于知识图谱的智能推荐系统-Sylvie小兔
- Limited query of common SQL operations
- 官宣!第三届云原生编程挑战赛正式启动!
- MySQL backup and recovery + experiment
猜你喜欢
Bert fine tuning skills experiment
. Net starts again happy 20th birthday
Yolov5 model training and detection
Yyds dry inventory swagger positioning problem ⽅ formula
Li Kou Jianzhi offer -- binary tree chapter
Practice of tdengine in TCL air conditioning energy management platform
A label making navigation bar
[technology development-26]: data security of new information and communication networks
"2022" is a must know web security interview question for job hopping
Naacl 2021 | contrastive learning sweeping text clustering task
随机推荐
February database ranking: how long can Oracle remain the first?
如何做一个炫酷的墨水屏电子钟?
Process scheduling and termination
[understanding of opportunity -38]: Guiguzi - Chapter 5 flying clamp - warning one: there is a kind of killing called "killing"
STL container
[Digital IC hand tearing code] Verilog edge detection circuit (rising edge, falling edge, double edge) | topic | principle | design | simulation
Pytorch register_ Hook (operate on gradient grad)
Bert fine tuning skills experiment
官宣!第三届云原生编程挑战赛正式启动!
Application and development trend of image recognition technology
MySQL regexp: Regular Expression Query
Win:使用组策略启用和禁用 USB 驱动器
Advanced learning of MySQL -- Application -- Introduction
batchnorm. Py this file single GPU operation error solution
Variables in postman
The application and Optimization Practice of redis in vivo push platform is transferred to the end of metadata by
Icu4c 70 source code download and compilation (win10, vs2022)
Incremental backup? db full
Subject 3 how to turn on the high beam diagram? Is the high beam of section 3 up or down
STM32 series - serial port UART software pin internal pull-up or external resistance pull-up - cause problem search