当前位置:网站首页>tianqf's problem-solving ideas
tianqf's problem-solving ideas
2022-08-09 07:05:00 【tqfChina】
def gcd(a, b):
if b == 0:
return a
else:
gcd(b, a%b)
def main():
pass
a = input('a:')
b = input('b:')
c = input('c:')
d = input('d:')
if a >= b:
return -1
if c >= d:
return -1
ac = a/gcd(a, c)*c
bd = gcd(b,d)
i = 0
while true:
i += ac
if i <= bd:
if bd%i==0 and i>max(a,c) and i < min(b,d):
print(i)
return 0
else:
return -1
main()
边栏推荐
- codeforces Valera and Elections (这思维题是做不明白了)
- 如何 认识与学习BASH
- SAP ALV data export many of the bugs
- vlucas/phpdotenv phpdotenv获取变量内容偶尔出现返回false
- 2017.10.26模拟 b energy
- imageio读取.exr报错 ValueError: Could not find a backend to open `xxx.exr‘ with iomode `r`
- 更改Jupyter Notebook默认打开目录
- P7 Alibaba Interview Questions 2020.07 Sliding Window Algorithm (Alibaba Cloud Interview)
- 找不到和chrome浏览器版本不同的chromedriver的解决方法
- cut命令的使用实例
猜你喜欢
随机推荐
composer 内存不足够
The water problem of leetcode
如何 认识与学习BASH
高项 03 项目立项管理
unity第一课
【sqlite3】sqlite3.OperationalError: table addresses has 7 columns but 6 values were supplied
leetcode:55. 跳跃游戏
(本章节完结)排序第五节——非比较排序(计数排序+基数排序+桶排序)(附有自己的视频讲解)
先序遍历,中序遍历,后序遍历,层序遍历
AD画PCB板教程 20分钟讲清楚操作流程 铺铜 网络标号
mysql 总结
图论,二叉树,dfs,bfs,dp,最短路专题
rsync:recv_generator: mkdir (in backup) failed:Permission denied (13) |failed to set times on '.'
Lottie系列一:介绍与使用
MongDb query method
我入职阿里后,才知道原来简历这么写
MVN 中配置flyway mysq
longest substring without repeating characters
用tensorflow.keras模块化搭建神经网络模型
codeforces Valera and Elections (这思维题是做不明白了)