单词查找树(python) 摘要:解题思路:注意事项:参考代码:class TrieNode: def __init__(self): self.children = {} self.is_end_o…… 题解列表 2023年12月17日 0 点赞 0 评论 235 浏览 评分:0.0
使用滑动窗口来解决 摘要:解题思路:注意事项:参考代码:n = int(input()) a = input().split() s = [] ans = 0 # 初始化收集的雪花数量 l, r = 0, 0 # …… 题解列表 2023年12月16日 0 点赞 0 评论 257 浏览 评分:9.9
找树根和孩子(python) 摘要:解题思路:注意事项:参考代码:def find_root(tree): # 找到根节点 nodes = set(tree.keys()) children = set() fo…… 题解列表 2023年12月15日 0 点赞 0 评论 197 浏览 评分:0.0
2950: 素数回文数的个数 Python简单实现 摘要:解题思路:分别判断是否为素数和回文判断回文的思路是,将整数转换为字符串,然后判断字符串的长度,依次比较首位和末位的值是否相等即可参考代码:# 判断是否为素数 def Prime(x): f…… 题解列表 2023年12月15日 0 点赞 0 评论 242 浏览 评分:0.0
奇数单增序列(python超简单方法) 摘要:解题思路:灵活使用列表推导式和sorted函数,python来写这道题不要太简单!四行代码直接解决参考代码:N = int(input())nums = sorted(map(int, input()…… 题解列表 2023年12月14日 0 点赞 0 评论 191 浏览 评分:0.0
编写题解 2794: 求平均年龄 摘要:解题思路:注意事项:参考代码:data_list = list(map(int, input().split())) # 第一行输入的数据 age_sum = 0 # 年龄总和 count =…… 题解列表 2023年12月14日 0 点赞 0 评论 645 浏览 评分:8.4
2947: 不吉利日期 Python 简单实现 摘要:解题思路:m保存每个月份的天数,week表示周几,当累加大于7的时候 对7取模即可注意事项:参考代码:w = int(input()) m = [0, 31, 28, 31, 30, 31, 30,…… 题解列表 2023年12月14日 0 点赞 0 评论 225 浏览 评分:0.0
编写题解 1762: printf基础练习 摘要:有手就行下面是python的代码python代码开荒,不是一直内容少怎么回事a = 123456789print("0%o 0x%x" %(a, a))…… 题解列表 2023年12月14日 0 点赞 0 评论 559 浏览 评分: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 评论 245 浏览 评分:9.9
编写题解 1023: [编程入门]选择排序 摘要:解题思路:注意事项:参考代码:def selection_sort(nums): for i in range(len(nums)): # 外循环 依次取数组中的每一个元素进行比较 …… 题解列表 2023年12月13日 0 点赞 0 评论 343 浏览 评分:9.9