题解列表

筛选

题解 1020: [编程入门]猴子吃桃的问题

摘要:解题思路:从最后一天倒推结果注意事项:1 第10天没有吃 只计算9天2 设每一天的总数为a总数a=吃掉(a/2+1)+剩余aa存在迭代关系   总数a=(剩余aa+1)*2剩余aa是第二天的总数a3 ……

一行导包,两行代码

摘要:解题思路:from datetime import date year,month,day=map(int,input().strip().split()) print(date(year,mon……

python 也就五六行吧 100

摘要:n=int(input().strip());la=[] for i in range(n):     l=list(map(int,input().split()))     if len(l……

密码破译[使用Python]

摘要:str1 = input() strList = list(str1) count = 0 chrNum = 0 while count < len(strList):     chrNum……

python-动态规划dp解题(简洁明了)

解题思路:01背包问题,利用动态规划思想,创建三个一维数组w[i],v[i],dp[i],分别用来存总价值=重要度*价格,价格,最大价值。注意事项:参考代码:n,m=map(int,input().split())w=[]v=[]dp=[0]*(n+1)foriinrange(m):a,