题解列表
动态规划思路详解-贪吃的大嘴
摘要:解题思路:注意事项:参考代码:def find_cakes(cakes, m):
# 初始化动态规划数组,dp[i][j]表示前i个小蛋糕中选择若干个,美味度之和为j所需的最小数量
……
编写题解 2791: 计算邮资python
摘要:参考代码:r, s = input().split()
r = int(r)
money = 8
if r > 1000:
money += (r-1000)//500*4
……
编写题解 2790: 分段函数python
摘要:参考代码:N = float(input())
if N >= 0 and N < 5:
print("%.3f" %(-N+2.5))
elif N >= 5 and N < 10:
……
编写题解 2789: 骑车与走路python
摘要:参考代码:n = int(input())
if n/3+50 == n/1.2:
print("All")
if n/3+50 > n/1.2:
print("Walk")
……
最长公共子序列lcs
摘要:解题思路:注意事项:参考代码:def longestCommonSubsequence(text1, text2): # 创建一个二维数组 dp,用于存储最长公共子序列的长度 ……
编写题解 2788: 晶晶赴约会python
摘要:解题思路:注意事项:参考代码:n = int(input())
if n <= 5:
if n % 2 == 0:
print("YES")
else:
 
编写题解 2787: 有一门课不及格的学生
摘要:解题思路:判断语句注意事项:判断他是否恰好有一门课不及格参考代码:ch, ma = map(int, input().split())
if ch < 60 and ma >= 60 :
……
最长不下降子序列的长度
摘要:解题思路:注意事项:参考代码:def lengthOfLIS(nums): if len(nums) <= 1: return len(nums) dp =……
2775: 等差数列末项计算python题解
摘要:解题思路:等差数列通项公式注意事项:先算公差参考代码:a1, a2, n = map(int, input().split())
d = a2-a1
an = a1+(n-1)*d
print(……