1255: 蓝桥杯算法提高-能量项链 DP解决 摘要: n = int(input()) a = list(map(int, input().split())) a.extend(a) a.append(a…… 题解列表 2021年11月04日 0 点赞 0 评论 700 浏览 评分:9.9
2^k进制数代码详细说明 摘要:解题思路:找到规律即可注意事项:主要要注意分段后可能剩下的不能组成k位的数值取值情况参考代码:import mathk,w=map(int,input().split())a=math.ceil(w/…… 题解列表 2021年11月03日 0 点赞 0 评论 531 浏览 评分:9.9
[编程入门]同因查找---for循环---(Python) 摘要:```python for i in range(10,1001): if i%2==0 and i%3==0 and i%7==0: print(i) ``` 通过…… 题解列表 2021年11月03日 0 点赞 1 评论 1040 浏览 评分:9.9
[编程入门]等差数列---for循环---(Python) 摘要:Python 每个数相差了3,所有每次循环对s都加上3用sum累加 ```python n=int(input()) sum=2 s=2 for i in range(1,n): …… 题解列表 2021年11月03日 0 点赞 0 评论 1256 浏览 评分:9.9
[编程入门]有规律的数列求和---for循环---(Python) 摘要:Python a等于b,b等于a+b ```python n=int(input()) a,b=1,2 sum1=0 for i in range(n): sum1+=float…… 题解列表 2021年11月03日 0 点赞 0 评论 485 浏览 评分:9.9
[编程入门]水仙花数判断---for循环---(Python) 摘要:Python 满足if条件为水仙花数将数值输出 ```python for i in range(100,1000): if i==((i%10)**3)+((i//10%10)**3…… 题解列表 2021年11月03日 0 点赞 0 评论 898 浏览 评分:6.7
[编程入门]求和训练---for循环---(Python) 摘要:```python a,b,c=map(int,input().split()) sum1=0 for i in range(1,a+1): sum1+=i for i in ran…… 题解列表 2021年11月03日 0 点赞 0 评论 686 浏览 评分:9.9
[编程入门]Sn的公式求和---for循环---(Python) 摘要:解题思路:注意事项:range是从零开始的,s,sn有初值参考代码:n=int(input())s=0sn=0for i in range(1,n+1): s=s*10+2 sn+=spr…… 题解列表 2021年11月03日 0 点赞 0 评论 1040 浏览 评分:8.0
[编程入门]温度转换---for循环---(Python) 摘要:解题思路:通过for循环遍历求出f注意事项:f为正数参考代码:for c in range(-100,151,5): f = int(32 + c* 9/5) print("c={}->f…… 题解列表 2021年11月02日 0 点赞 0 评论 1182 浏览 评分:9.9
蛇行矩阵Python解题 摘要:解题思路:双重for循环注意事项:注意m的计算方式参考代码:while True: n=int(input()) for i in range(n): m = int((i+…… 题解列表 2021年11月02日 0 点赞 0 评论 468 浏览 评分:9.9