1099: 校门外的树,使用列表切片 摘要:解题思路:运用列表的切片操作,将区间内的点都设为0注意事项:给的区间可能会有重叠参考代码:L,m = map(int,input().strip().split())tree =[1]*(L+1)fo…… 题解列表 2024年04月19日 1 点赞 0 评论 417 浏览 评分:10.0
python--study||O.o 摘要:参考代码:# 重点就是判断条件的顺序 n = int(input()) square = [[0] * (2 * n - 1) for _ in range(2 * n - 1)] x, y…… 题解列表 2024年04月19日 0 点赞 0 评论 343 浏览 评分:6.0
python解求得最大值 摘要:### 解题代码: ```python n = int(input()) sz = [list(map(int, input().strip().split())) for _ in range…… 题解列表 2024年04月18日 0 点赞 0 评论 290 浏览 评分:0.0
自定义函数之数字后移 摘要:解题思路:注意事项:参考代码:n = int(input()) arr = list(map(str, input().split())) m = int(input()) print('…… 题解列表 2024年04月18日 0 点赞 0 评论 545 浏览 评分:0.0
自定义函数之整数处理 摘要:解题思路:注意事项:先交换大的,再交换小的。参考代码:arr = list(map(int, input().split())) max_number = max(arr) min_number …… 题解列表 2024年04月18日 0 点赞 0 评论 743 浏览 评分:0.0
自定义函数之字符类型统计 摘要:解题思路:注意事项:参考代码:def function(x): a, b, c, d = 0, 0, 0, 0 for i in x: if i.isalpha(…… 题解列表 2024年04月18日 0 点赞 0 评论 448 浏览 评分:0.0
自定义函数之数字分离 摘要:解题思路:注意事项:参考代码:def function(x): return print(' '.join(x)) if __name__ == '__main…… 题解列表 2024年04月18日 0 点赞 0 评论 297 浏览 评分:0.0
自定义函数之字符提取 摘要:解题思路:注意事项:参考代码:def function(x): aeiou = "aeiou" str = [] for i in x: if i 题解列表 2024年04月18日 0 点赞 0 评论 274 浏览 评分:0.0
二维数组的转置 摘要:解题思路:注意事项:参考代码:def function(arr): list = [] for j in range(3): str = "" 题解列表 2024年04月18日 0 点赞 0 评论 452 浏览 评分:0.0
自定义函数处理素数 摘要:解题思路:注意事项:参考代码:def function(x): for i in range(2, x): if x % i == 0: &nbs 题解列表 2024年04月18日 0 点赞 0 评论 834 浏览 评分:0.0