蓝桥杯2022年积木画(python AC) 摘要:解题思路:对于这种在每一输入都有固定答案并且当前结果受前结果影响的情况下,动态规划是很好的选择;对于这道题来看,假设输入的N为i,2*N 的画布中有多少组合其实是受到 i-1 或者输入数 i 前任意一…… 题解列表 2022年08月10日 0 点赞 0 评论 966 浏览 评分:9.9
不会简单的写法 解题思路:注意事项:参考代码:a=list(map(int,input().split()))b=list(map(int,input().split()))c=0d=0e=0foriina:ifi>=0:d+=ie+=1else:c+=1foriinb:ifi>=0:d+=ie+=1else:c+= 题解列表 2022年08月10日 0 点赞 0 评论 667 浏览 评分:9.9
这种题还需要看题解吗? 摘要:解题思路:就循环注意事项:参考代码:for i in range(10,1001): if i%2==0 and i%3==0 and i%7==0: print(i)…… 题解列表 2022年08月10日 0 点赞 0 评论 758 浏览 评分:9.9
1083——————Hello,World! 题目1083:Hello,world!**题目描述**Thisisthefirstproblemfortest.SinceallweknowtheASCIIcode,yourjobissimple:Inputnumbersandoutputcorrespondingmessages.——翻译(来源百度 题解列表 2022年08月09日 0 点赞 0 评论 1096 浏览 评分:0.0
1071——————阶乘公式求职 n=int(input())t=1s=0foriinrange(1,n+1):t=t*is=s+1.0/tprint('sum=%.5f'%(s*1.0))#凑字数凑字数凑字数凑字数凑字数凑字数凑字数 题解列表 2022年08月09日 0 点赞 0 评论 599 浏览 评分:0.0
耍个小聪明 #Python解决平方根问题在python中,math库提供sqrt()函数来完成平方根操作。那还有啥好说的?!```pythonimportmatha=int(input())print("%.3f"%math.sqrt(a))```别说迭代了,循环都没有用上。。。 题解列表 2022年08月08日 1 点赞 0 评论 817 浏览 评分:10.0
蛇形矩阵(python) 摘要:解题思路:找到合适的算法,定义函数进行计算注意事项:参考代码:def f(N): for i in range(1, N + 1): for j in range(i, N + 1…… 题解列表 2022年08月07日 0 点赞 0 评论 493 浏览 评分:0.0
字符串的输入输出处理(python) 摘要:解题思路:前两行正常输出,后面按要求输出,注意数值的一些限制注意事项:注意输出格式,要用两个“\n”参考代码:N = int(input())if 0 < N <= 100: for i in…… 题解列表 2022年08月07日 0 点赞 0 评论 445 浏览 评分:0.0
假装用字典解题 摘要:解题思路:求阶乘和分解数字合在一起了注意事项:输出可以用排序的,用字典那更麻烦,应用列表也不是不行'''这里面是字符串排序偷懒输出(两者效果一样)'''…… 题解列表 2022年08月06日 0 点赞 1 评论 540 浏览 评分:4.0
数字逆序输出——两行代码 摘要:# 数字逆序输出——两行代码 其实并不需要把输入转换成列表,直接用字符串就可以实现操作 ```python a = input() print(a[::-1]) ``` 两行代码完美解决逆…… 题解列表 2022年08月06日 0 点赞 0 评论 634 浏览 评分:8.0