接龙数列动态规划的python写法 摘要:解题思路:极简 线性DP-Dotcpp编程社区dp[]数组长度设置为10,因为接龙数列的每一项均为数字,从1~9,0不需要考虑进去;dp[]数组的含义:以i结尾的接龙数列的最大长度;设a为接龙数列的第…… 题解列表 2024年02月04日 0 点赞 0 评论 675 浏览 评分:8.0
最简洁的解 摘要:参考代码:n = int(input()) # 初始饮料数和瓶盖数 total_drinks = n caps = n # 不断循环,直到无法再换取新的饮料 while caps >…… 题解列表 2024年02月04日 0 点赞 0 评论 312 浏览 评分:9.9
这道题是背包问题 摘要:解题思路:注意事项:【【Python算法实战】背包问题】 https://www.bilibili.com/video/BV1PA411J7Zh/?share_source=copy_web&vd_s…… 题解列表 2024年02月04日 0 点赞 0 评论 475 浏览 评分:9.9
计算邮资python版 摘要:解题思路:注意事项:参考代码:import mathwhile True: try: base = 8 t, q = input().strip().split() …… 题解列表 2024年02月03日 0 点赞 0 评论 390 浏览 评分:9.9
python版代码!!!! 摘要:解题思路:注意事项:参考代码:def f(x): if 0 <= x < 5: result = -x + 2.5 elif 5 <= x < 10: resu…… 题解列表 2024年02月03日 0 点赞 0 评论 412 浏览 评分:6.0
python四行搞定 摘要:解题思路:注意事项:参考代码:list,num = [3,5,7],int(input())for i in list: if num % i == 0:print(i,end=' &#…… 题解列表 2024年02月03日 3 点赞 0 评论 646 浏览 评分:9.9
判断是否为两位数 摘要:解题思路:将输入的整数存在列表中 判断列表长度 就可以得出是否为两位数注意事项:参考代码:while True: try: num = input() num_lis…… 题解列表 2024年02月03日 0 点赞 0 评论 425 浏览 评分:6.0
python选择排序 摘要:解题思路:从第[0]开始作为最小值,将最小值与最小值后的每一位比较找出极小值,循环得出最小排序注意事项:参考代码:x = list(map(int,input().split()))t=0for i …… 题解列表 2024年02月03日 1 点赞 0 评论 548 浏览 评分:9.9
题解 1051: python字典做法 摘要:解题思路: 1.数据输入: 通过input()函数获取输入的整数N,表示学生人数。使用for循环迭代N次,每次输入一个学生的信息,包括学号(num)、姓名(name)、语文成绩(score…… 题解列表 2024年02月01日 0 点赞 0 评论 406 浏览 评分:9.9
数组逆序重放的三种满分题解 摘要:解题思路:注意事项:参考代码:第一种.巧调放入位置法n=int(input())list1=list(map(int,input().split()))ls=[]for i in list1: …… 题解列表 2024年02月01日 0 点赞 0 评论 460 浏览 评分:9.9