题解列表

筛选

题解 : DNA【Python】

摘要:解题思路:对于一个单位的dna串,我们可以先打印其a-1行,重复b-1次,然后打印最后一行:参考代码:def dna(a):     # 先创建 (a-1)*a 的二维列表,元素都为 空格'……

Cylinder题解简短易懂python

摘要:解题思路:注意事项:注意分两种情况讨论,还有不要自己定义pi。。。。参考代码:import mathpi=math.piwhile True:    w,h=map(float,input().spl……

2792: 三角形判断

摘要:解题思路:注意事项:参考代码:a,b,c = map(int,input().strip().split())if a + b > c and a + c > b and b + c > a:    ……

2791: 计算邮资

摘要:解题思路:注意事项:参考代码:a, b = input().strip().split()a = int(a) ; b = str(b)    # 这里的b转换类型只是为了增加程序可读性,可以不用转换……

2790: 分段函数

摘要:解题思路:注意事项:参考代码:import sysx = float(input())if x < 0 or x >= 20:    sys.exit()elif x < 5:    print(&#……

题解: 数字三角形【Python】

摘要:解题思路:动态规划参考代码:N = int(input()) dp = [] for i in range(N):     row = list(map(int, input().split()……

题解: 公交汽车【Python】

摘要:解题思路:动态规划。参考代码:cost = list(map(int, input().split())) n = int(input()) dp = [0 for i in range(n)] ……

题解:装箱问题【Python求解】

摘要:解题思路:递归参考代码:## 递归算法 V = int(input())     n = int(input()) v_lis = [] for i in range(n):     v =……