题解列表

筛选

第十四届省赛真题填充

摘要:解题思路:注意事项:s=input() l=len(s) i=0 ss=["11","00","?1","?0","0?","1?","??"] c=0 while i<l-1:     ……

天才的写法

摘要:解题思路:注意事项:参考代码:while True:    try:        array = list(map(int, input().split()))        array_odd =……

计算书费元组方法

摘要:解题思路:注意事项:参考代码:prices=[28.9,32.7,45.6,78,35,86.2,27.8,43,56,65]counts=list(map(int,input().strip().s……

用字典循环一次解决

摘要:解题思路:因为需要每一个元素都为n/10,我们只需要先找到代价大的放入字典,且满足次数为n/10,只改变剩余的元素,代价之和就是最小的。注意事项:参考代码:n=int(input())a=[tuple……

编写题解 1366: 超级书架2

摘要:解题思路:注意事项:参考代码:n,b=map(int,input().split())#奶牛数量与书架高度h_list=[]#存放奶牛身高h=0#初始高度t=0#用了多少头奶牛for i in ran……

动态规划-编辑距离

摘要:解题思路:注意事项:a = list(input()) b = list(input()) dp = [[0 for i in range(len(b)+1)]for j in range(len……

编写题解 3046: 最小新整数

摘要:解题思路:注意事项:参考代码:def dele(s,k):    d=list(str(s))#int类型不能直接转换成list    j=0#删除次数    flag=0#是否程序空转(未执行删除操……

python编写题解 2773: 计算线段长度

摘要:解题思路:两点间距离公式注意事项:测试数据都是一组,不是两组。参考代码:from math import sqrt number = input().split() if len(number) ……