小白随便写的,记录一下 摘要:```python # 利用map函数和list把输入转为int型列表 li = list(map(int, input().split())) li.sort() # 利用内置函数进行排序…… 题解列表 2024年03月24日 0 点赞 0 评论 331 浏览 评分:0.0
小白随便写的,记录一下 摘要:```python def select_sort(li): n = len(li) for i in range(n): # 多一次循环 for j in …… 题解列表 2024年03月24日 0 点赞 0 评论 404 浏览 评分:0.0
2236: 蓝桥杯算法训练-大小写转换 摘要:参考代码:s = list(input()) for i in range(len(s)): if s[i].isupper(): s[i] = s[i].lower()…… 题解列表 2024年03月24日 0 点赞 0 评论 652 浏览 评分:0.0
动态规划-python 摘要:解题思路:其实就是求最大不下降子序列和最大不上升子序列,我的r【i】数组表示以num【i】结尾的最长不降序子序列的长度,d【i】表示以num【i】开头的最大不上升子序列,就是先上后下类似于一个抛物线,…… 题解列表 2024年03月24日 1 点赞 0 评论 335 浏览 评分:9.9
小白随便写的,记录一下 摘要:```python def print_line(li): for i in li: print(i, end=' ') print() def un…… 题解列表 2024年03月24日 0 点赞 0 评论 317 浏览 评分:9.9
小白随便写的,记录一下 摘要:看不懂可以看看这个视频:https://www.bilibili.com/video/BV1uA411N7c5?p=56&vd_source=a90641eb5a4eed71d3374febc12dd…… 题解列表 2024年03月24日 0 点赞 0 评论 361 浏览 评分:0.0
最长上升子序列(python) 摘要:解题思路:时间复杂度O(n^2),详解可以去看我的另一篇:最长不下降子序列注意事项:参考代码:n=int(input()) b=list(map(int,input().split())) dp=…… 题解列表 2024年03月23日 0 点赞 0 评论 389 浏览 评分:9.9
动态规划——求最长不下降子序列(python详解) 摘要:解题思路:吐槽官方,写了一大堆,然后说我的题目太短,结果写的全没了!!! dp【i】的含义为,以b【i】结尾的最长不下降子序列是多少然后我们要确定上一状态,首先如果我们以b【i】结尾,那么我们得上一个…… 题解列表 2024年03月23日 0 点赞 0 评论 624 浏览 评分:9.9
题解 2903: 不高兴的津津 摘要:解题思路:注意事项:参考代码:hour_max = day = 0 for i in range(1, 7 + 1): hour1, hour2 = map(int, input().sp…… 题解列表 2024年03月23日 0 点赞 0 评论 336 浏览 评分:0.0
题解 1099: 校门外的树 摘要:解题思路:注意事项:参考代码:L, M = map(int, input().split()) trees = [1 for x in range(L+1)] for x in range(M):…… 题解列表 2024年03月23日 0 点赞 0 评论 271 浏览 评分:0.0