可以直接用sort,我头铁自己写的快速排序 摘要:解题思路:注意事项:参考代码:: def quick_sort_pivot(a, start, end): pivot = start j = start + 1 for i in …… 题解列表 2024年03月09日 0 点赞 0 评论 573 浏览 评分:0.0
计算书费元组方法 摘要:解题思路:注意事项:参考代码:prices=[28.9,32.7,45.6,78,35,86.2,27.8,43,56,65]counts=list(map(int,input().strip().s…… 题解列表 2024年03月09日 0 点赞 0 评论 575 浏览 评分:9.9
用字典循环一次解决 摘要:解题思路:因为需要每一个元素都为n/10,我们只需要先找到代价大的放入字典,且满足次数为n/10,只改变剩余的元素,代价之和就是最小的。注意事项:参考代码:n=int(input())a=[tuple…… 题解列表 2024年03月09日 0 点赞 0 评论 755 浏览 评分:7.3
编写题解 1366: 超级书架2 摘要:解题思路:注意事项:参考代码:n,b=map(int,input().split())#奶牛数量与书架高度h_list=[]#存放奶牛身高h=0#初始高度t=0#用了多少头奶牛for i in ran…… 题解列表 2024年03月08日 0 点赞 0 评论 503 浏览 评分:0.0
动态规划-编辑距离 摘要:解题思路:注意事项:a = list(input()) b = list(input()) dp = [[0 for i in range(len(b)+1)]for j in range(len…… 题解列表 2024年03月08日 0 点赞 0 评论 502 浏览 评分:0.0
编写题解 3046: 最小新整数 摘要:解题思路:注意事项:参考代码:def dele(s,k): d=list(str(s))#int类型不能直接转换成list j=0#删除次数 flag=0#是否程序空转(未执行删除操…… 题解列表 2024年03月07日 0 点赞 0 评论 526 浏览 评分:0.0
python编写题解 2773: 计算线段长度 摘要:解题思路:两点间距离公式注意事项:测试数据都是一组,不是两组。参考代码:from math import sqrt number = input().split() if len(number) …… 题解列表 2024年03月07日 3 点赞 4 评论 1247 浏览 评分:9.9
python编写题解 1480: 模拟计算器 摘要:注意事项: 商是整除while True: try: a, b, c = map(str, input().split()) a, b = int(a),…… 题解列表 2024年03月07日 0 点赞 0 评论 503 浏览 评分:0.0
python编写题解 1028: [编程入门]自定义函数求一元二次方程 摘要:解题思路:参考代码:from math import sqrt a, b, c = map(int, input().split()) d = b**2-4*a*c e = sqrt(4*a*c…… 题解列表 2024年03月07日 0 点赞 0 评论 760 浏览 评分:0.0
python编写题解 2793: 点和正方形的关系 摘要:解题思路:求x,y的区间注意事项:判断一个给定的点是否在这个正方形内参考代码:x, y = map(int, input().split()) if x >= -1 and x <= 1 and y…… 题解列表 2024年03月07日 0 点赞 0 评论 1047 浏览 评分:0.0