金币获取问题(python易理解写法) 摘要:解题思路:此题由于金币获取的方法,所以不能直接遍历天数和金币,所以要定义一个变量去过渡参考代码:n = int(input())day = 0 #天数sum = 0 #金币数for i i…… 题解列表 2023年12月13日 0 点赞 0 评论 319 浏览 评分:9.9
画矩形(python) 摘要:解题思路:用两个循环打出长宽的边,再用if判断是否为实心参考代码:length, width, symbol, solid = map(str, input().split()) for i in …… 题解列表 2023年12月13日 0 点赞 0 评论 221 浏览 评分:9.9
统计2出现的次数(python简单方法) 摘要:解题思路:用for循环将数字已字符串的形式添加到列表中,用count函数统计2的数量参考代码:L, R = map(int, input().split()) num_list = [] for …… 题解列表 2023年12月13日 0 点赞 0 评论 224 浏览 评分:0.0
python 线性筛法 摘要:解题思路:注意事项:参考代码:n=int(input()) ps=[True]*(n+1) p=[] for i in range(2,n+1): if ps[i]: …… 题解列表 2023年12月13日 0 点赞 0 评论 389 浏览 评分:9.9
python来解一下 摘要:解题思路:while True: try: s=list(map(int,input().split())) n,m,items=s[0],s[1],s[2:] a=[i for…… 题解列表 2023年12月13日 0 点赞 0 评论 210 浏览 评分:6.0
选择排序python 摘要:解题思路: 选择排序的时间复杂度是O(n^2),其中n是待排序元素的数量。这是因为选择排序的基本操作是交换和比较,而每次交换和比较都需要遍历整个数组,因此时间复杂度为O(n^2)题意直接…… 题解列表 2023年12月13日 0 点赞 0 评论 213 浏览 评分:0.0
纸张尺寸(python硬核解法) 摘要:解题思路:给定了初始纸张的尺寸,后面按照思路一步一步来就行,直接看注释参考代码:import math #因为题目要求向下取整,所以要导入math模块 p = list(input())…… 题解列表 2023年12月13日 0 点赞 0 评论 272 浏览 评分:0.0
编写题解 1505: 蓝桥杯算法提高VIP-单词个数统计 摘要:解题思路:注意事项:参考代码:word_list = list(input().split()) print(len(word_list))…… 题解列表 2023年12月12日 0 点赞 0 评论 197 浏览 评分:0.0
阶乘(常规) 摘要:def f(n): if n==1: return 1 else: return n*f(n-1) lst=[f(i) for i in 题解列表 2023年12月12日 0 点赞 0 评论 186 浏览 评分:0.0
字符与ascll码值的转换 摘要:解题思路:注意事项:补充题解中Python代码空缺参考代码:print(ord("t"))print(chr(63))…… 题解列表 2023年12月12日 0 点赞 2 评论 546 浏览 评分:8.0