leetcode卡-ps:保存我的问题解决跟踪,我的错

时间:2021-07-06 20:57:39
【文件属性】:
文件名称:leetcode卡-ps:保存我的问题解决跟踪,我的错
文件大小:11KB
文件格式:ZIP
更新时间:2021-07-06 20:57:39
系统开源 leetcode卡问题解决 本文档的目的是描述我研究的新算法并在遇到新问题时检查我的错误 2019.02.28 gcd 和 lcm class Solution: def __init__(self): self.__t = int(input()) self.__sol() def __sol(self): for i in range(0,self.__t): a,b = map(int,input().split()) print(self.__lcm(a,b)) def __gcd(self,a,b): if a>b: tmp = a a = b b = tmp # a < b while a != 0: n = b%a b = a a = n return b def __lcm(self,a,b): return int(a*b/self.__gcd(a,b)) if __name__ == "__main__": s = Solution() 上面的代码就是gcd和lcm,用欧几里得方法解决这类问题。 2019.01.06 匹配括号问题 边缘情况 匹配,但保留括
【文件预览】:
ps-master
----.gitignore(157B)
----README.md(3KB)
----문제 오답노트.docx(10KB)

网友评论