题解列表

筛选

读懂题目就是一道简单题

解题思路:n=int(input())arr1=[0]+list(map(int,input().split()))arr2=[0]+list(map(int,input().split()))defcheck(x):whilex>0:t=x%10ift%2==0andt<5:returnTruex=

1738: 排序 -python归并排序

摘要:注意事项: 注意输入输出参考代码:# 归并排序_升序 def merge_sort(nums):     # 待排序数组只有一个元素 => 无需排序 返回     if len(nums) <=……

筛选N以内的素数 python

摘要:解题思路:注意事项:参考代码:n=int(input())tag=0for i in range(2,n+1):    if i>2:        for j in range(2,i):     ……

1738: 排序 -希尔排序

**注意输入输出**```python#希尔排序defshell_sort(nums):#间隙初始为数组长度的一半gap=len(nums)//2#当间隙大于0时继续排序whilegap>0:#开始插入排序foriinrange(0,len(nums),

1738: 排序 -插入排序

摘要:注意事项: 注意输入输出参考代码:# 插入排序_升序 def insertion_sort(nums):     # 遍历数组     for i in range(1, len(nums)):……

1738: 排序 -选择排序

摘要:注意事项:注意输入输出格式参考代码:def selection_sort(nums):     length = len(nums)     for i in range(length):   ……

编写题解 1317: 最长公共子序列lcs

解题思路:注意事项:参考代码:a,b=input().strip().split()n=len(a)m=len(b)d=[[0]*(m+1)for_inrange(n+1)]foriinrange(1,n+1):forjinrange(1,m+1):ifa[i-1]==b[j-1]:d[i][j]=d

判断是否为两位数之入门

摘要:解题思路:注意事项:参考代码:while True:    try:        n=int(input())        print("1") if 0.1<= n/100 <1 else pr……