做题记录2022.2.7(ac:100%) 摘要:解题思路:采用深度优先搜索和回溯 是8皇后问题的拓展和延伸注意事项:参考代码:def check(row, column, pattern): global w…… 题解列表 2022年02月07日 0 点赞 0 评论 254 浏览 评分:0.0
Python解法,六行轻松搞定! 摘要:解题思路:①根据条件缩小第一个数的取值范围,因为最大为987,最小为123,故第一个数最小为123,最大为987的三分之一即329.对此范围的数进行遍历。②通过set()函数去重,然后判断集合元素个数…… 题解列表 2022年02月07日 0 点赞 0 评论 401 浏览 评分:9.9
优质题解 python-最优包含 摘要:解题思路:动态规划。①创建一个大小为(n+1)*(m+1)的二维数组,命名为dp,n和m分别为字符串s、t的长度。 其中dp[i][j]表示s中的前i个字符要想包含t的前j个字符最少需要修改几次。…… 题解列表 2022年02月07日 0 点赞 0 评论 606 浏览 评分:9.9
编写题解 1011: [编程入门]最大公约数与最小公倍数 摘要:解题思路:其中有为最大公因数,最小公倍数的先讨论;eg 6 2然后是找最小数的因数再找共同的因数注意事项:参考代码:def f(a,b): yinshu=[] gys=[] q=0 …… 题解列表 2022年02月07日 0 点赞 0 评论 305 浏览 评分:0.0
1259: 送分题素数 摘要:解题思路:注意事项:参考代码:def get(n): s=0 for i in range(2,n//2+1): if n%i==0:   题解列表 2022年02月07日 0 点赞 0 评论 280 浏览 评分:0.0
1234: 检查一个数是否为质数 摘要:解题思路:注意事项:参考代码:n=int(input()) s=0 for i in range(2,n//2+1): if n%i==0: print('N…… 题解列表 2022年02月07日 0 点赞 0 评论 312 浏览 评分:0.0
1232: 查找最大元素 摘要:解题思路:注意事项:参考代码:while True: try: a=input() s=max(a) str='' for i in a: if i!=s: …… 题解列表 2022年02月07日 0 点赞 0 评论 272 浏览 评分:0.0
1229: 最小公倍数 摘要:解题思路:注意事项:参考代码:a,b=map(int,input().split()) def get(a,b): if a%b==0: return b e…… 题解列表 2022年02月07日 0 点赞 1 评论 306 浏览 评分:0.0
python-单词分析 摘要:解题思路:注意事项:参考代码:A = list(input().strip()) B = set(A) rst = dict() for item in B: rst.…… 题解列表 2022年02月06日 0 点赞 0 评论 526 浏览 评分:8.0
python-成绩分析 摘要:解题思路:注意事项:参考代码:n = int(input().strip()) A = [] for i in range(n): A.append(int(input().strip(…… 题解列表 2022年02月06日 0 点赞 0 评论 369 浏览 评分:4.7