归并排序(python) 摘要:解题思路:注意事项:参考代码:def merge_sort(nums): if len(nums) <= 1: return nums # 分割阶段 mid = len…… 题解列表 2023年12月18日 0 点赞 0 评论 318 浏览 评分:0.0
堆排序(python) 摘要:解题思路:注意事项:参考代码:def heapify(nums, n, i): if len(nums) <= 1: return nums largest = i # 初…… 题解列表 2023年12月18日 0 点赞 0 评论 249 浏览 评分:0.0
快速排序(python) 摘要:解题思路:注意事项:参考代码:def quick_sort(nums): if len(nums) <= 1: return nums pivot = nums[le…… 题解列表 2023年12月18日 0 点赞 0 评论 279 浏览 评分:0.0
第K极值(python) 摘要:解题思路:注意事项:参考代码:def is_prime(num): if num <= 1: return False for i in range(2, int(num *…… 题解列表 2023年12月18日 0 点赞 0 评论 309 浏览 评分:0.0
数列排序(python) 摘要:解题思路:注意事项:参考代码:n=int(input())for _ in range(n): nums=list(map(int,input().split())) left=[] …… 题解列表 2023年12月18日 0 点赞 0 评论 240 浏览 评分:0.0
绝对值排序(python) 摘要:解题思路:注意事项:参考代码:while True: nums = list(map(int, input().split())) n = nums[0] if n == 0: …… 题解列表 2023年12月18日 0 点赞 0 评论 240 浏览 评分:0.0
2999: 牛吃牧草 摘要:解题思路:#设一头牛一天吃n份草#原有s份草#每天增加a份草得方程s+20a=15n*20 s+10a=20n*10解得a/n=(15*20-20*10)/(20-10)=10注意事项:参考代码:…… 题解列表 2023年12月17日 4 点赞 0 评论 1590 浏览 评分:7.3
成绩排序(python匿名函数解法) 摘要:解题思路:思路不难,python创建一个列表存储姓名和成绩,然后再将所有人的成绩存储到一个列表当中,直接用sort函数搭配lambda匿名函数对成绩和名字的字典序进行排序,再用for循环一一输出即可注…… 题解列表 2023年12月17日 0 点赞 0 评论 379 浏览 评分:0.0
车厢调度(python) 摘要:解题思路:注意事项:参考代码:def trainSchedule(n, order): stack = [] next_car = 1 for car in order: …… 题解列表 2023年12月17日 0 点赞 0 评论 339 浏览 评分:2.0
编写题解 2787: 有一门课不及格的学生 摘要:解题思路:注意事项:参考代码:score = list(map(int, input().split())) if min(score) < 60: if max(score) >= 60…… 题解列表 2023年12月17日 1 点赞 0 评论 347 浏览 评分:10.0