求后序遍历(python) 摘要:解题思路:注意事项:参考代码:def build_tree(preorder, inorder): if not preorder or not inorder: return N…… 题解列表 2023年12月17日 0 点赞 0 评论 472 浏览 评分:0.0
单词查找树(python) 摘要:解题思路:注意事项:参考代码:class TrieNode: def __init__(self): self.children = {} self.is_end_o…… 题解列表 2023年12月17日 0 点赞 0 评论 474 浏览 评分:0.0
使用滑动窗口来解决 摘要:解题思路:注意事项:参考代码:n = int(input()) a = input().split() s = [] ans = 0 # 初始化收集的雪花数量 l, r = 0, 0 # …… 题解列表 2023年12月16日 0 点赞 0 评论 634 浏览 评分:9.9
找树根和孩子(python) 摘要:解题思路:注意事项:参考代码:def find_root(tree): # 找到根节点 nodes = set(tree.keys()) children = set() fo…… 题解列表 2023年12月15日 0 点赞 0 评论 477 浏览 评分:0.0
2950: 素数回文数的个数 Python简单实现 摘要:解题思路:分别判断是否为素数和回文判断回文的思路是,将整数转换为字符串,然后判断字符串的长度,依次比较首位和末位的值是否相等即可参考代码:# 判断是否为素数 def Prime(x): f…… 题解列表 2023年12月15日 0 点赞 0 评论 594 浏览 评分:0.0
奇数单增序列(python超简单方法) 解题思路:灵活使用列表推导式和sorted函数,python来写这道题不要太简单!四行代码直接解决参考代码:N=int(input())nums=sorted(map(int,input().split()))ji=[str(i)foriinnumsifi%2==1]print(', 题解列表 2023年12月14日 0 点赞 0 评论 479 浏览 评分:0.0
编写题解 2794: 求平均年龄 摘要:解题思路:注意事项:参考代码:data_list = list(map(int, input().split())) # 第一行输入的数据 age_sum = 0 # 年龄总和 count =…… 题解列表 2023年12月14日 0 点赞 0 评论 933 浏览 评分:8.4
2947: 不吉利日期 Python 简单实现 摘要:解题思路:m保存每个月份的天数,week表示周几,当累加大于7的时候 对7取模即可注意事项:参考代码:w = int(input()) m = [0, 31, 28, 31, 30, 31, 30,…… 题解列表 2023年12月14日 0 点赞 0 评论 537 浏览 评分:0.0
编写题解 1762: printf基础练习 有手就行下面是python的代码python代码开荒,不是一直内容少怎么回事a=123456789print("0%o0x%x"%(a,a)) 题解列表 2023年12月14日 0 点赞 0 评论 878 浏览 评分:0.0
第一!!!!!!! 摘要:解题思路:注意事项:参考代码:n=int(input())sum=0for temp in range(1,n+1): flag=1 if temp%7==0: contin…… 题解列表 2023年12月14日 0 点赞 0 评论 516 浏览 评分:9.9