筛选N以内的素数 python 摘要:解题思路:注意事项:参考代码:n=int(input())tag=0for i in range(2,n+1): if i>2: for j in range(2,i): …… 题解列表 2024年10月28日 0 点赞 0 评论 245 浏览 评分:0.0
猴子吃桃的问题python 摘要:解题思路:注意事项:参考代码:n=int(input())num=1for i in range(1,n): num=2*(num+1)print(num)…… 题解列表 2024年10月28日 0 点赞 0 评论 185 浏览 评分:0.0
1738: 排序 -希尔排序 摘要:**注意输入输出** ```python # 希尔排序 def shell_sort(nums): # 间隙初始为数组长度的一半 gap = len(nums) // 2 …… 题解列表 2024年10月28日 0 点赞 0 评论 383 浏览 评分:0.0
1738: 排序 -插入排序 摘要:注意事项: 注意输入输出参考代码:# 插入排序_升序 def insertion_sort(nums): # 遍历数组 for i in range(1, len(nums)):…… 题解列表 2024年10月27日 0 点赞 0 评论 367 浏览 评分:0.0
1738: 排序 -选择排序 摘要:注意事项:注意输入输出格式参考代码:def selection_sort(nums): length = len(nums) for i in range(length): …… 题解列表 2024年10月27日 0 点赞 0 评论 293 浏览 评分:0.0
编写题解 1317: 最长公共子序列lcs 摘要:解题思路:注意事项:参考代码:a,b = input().strip().split()n = len(a)m = len(b)d = [[0]*(m+1) for _ in range(n+1)]f…… 题解列表 2024年10月26日 0 点赞 0 评论 292 浏览 评分:0.0
判断是否为两位数之入门 摘要:解题思路:注意事项:参考代码:while True: try: n=int(input()) print("1") if 0.1<= n/100 <1 else pr…… 题解列表 2024年10月26日 0 点赞 0 评论 512 浏览 评分:9.9
数字的处理与判断python解 摘要:sd = input() print(len(sd)) print(' '.join(sd), end='') print("\n"+sd[::-1])注意事项:…… 题解列表 2024年10月26日 1 点赞 0 评论 304 浏览 评分:9.9
1316: 最长不下降子序列的长度 摘要:解题思路:注意事项:参考代码:n = int(input())l = list(map(int,input().split()))memo = {}def find(i): if i in me…… 题解列表 2024年10月25日 0 点赞 0 评论 178 浏览 评分:0.0
Python "结构体"的多参数排序 摘要: from functools import cmp_to_key def cmp(a,b): if a[3] 5: for j in range(…… 题解列表 2024年10月25日 0 点赞 0 评论 184 浏览 评分:9.9