利用斐波那契数列求解 解题思路:观察发现,分母的值,从第三个分数开始,为前两个的和,分子也有类似的规律,如果纯在数列f(n)=f(n-1)+f(n-2),其中f(0)=1,f(1)=2.则sum=f(1)/f(0)+f(2)/f(1)+f(3)/f(2)......f(N)/f(N-1)斐波那契数列是一个经典的数学问题, 题解列表 2024年04月21日 0 点赞 0 评论 633 浏览 评分:9.9
python--study||O.o 摘要:参考代码:s = input() res = 0 i = 0 while i < len(s) - 1: if s[i] == s[i + 1] or s[i] == '?&#…… 题解列表 2024年04月21日 0 点赞 0 评论 664 浏览 评分:0.0
python--study||O.o 摘要:参考代码:n = int(input()) a = list(map(int, input().split())) b = list(map(int, input().split())) c =…… 题解列表 2024年04月21日 0 点赞 0 评论 713 浏览 评分:0.0
转化为数组 摘要:解题思路:强制类型转换求和注意事项:无参考代码:for i in range(100,1000): my_str = str(i) sum = int(my_str[0]) ** 3 + …… 题解列表 2024年04月21日 0 点赞 0 评论 806 浏览 评分:9.9
python--study||O.o 摘要:参考代码:t = int(input()) res_min, res_max = 0, 1e10 for _ in range(t): a, b = map(int, input().s…… 题解列表 2024年04月21日 0 点赞 0 评论 494 浏览 评分:0.0
python--study||O.o 摘要:参考代码:n = int(input()) arr = list(map(str, input().split())) #dp[i]是以i为数字结尾的最长接龙子序列的长度 dp = [0] * …… 题解列表 2024年04月21日 0 点赞 0 评论 660 浏览 评分:9.9
python--study||O.o 摘要:参考代码:#time是之前的飞机降落所需的时间 def dfs(step, time): if step == n: return True for i in …… 题解列表 2024年04月21日 0 点赞 0 评论 587 浏览 评分:0.0
简单易懂方法 摘要:解题思路:用while True实现无限循环,观察发现,输入n,则第一行首尾为“*”,中间为n个空格,这样的行共有n行,总共有n+1行,且第n+1行为n+2个“*”注意事项:注意try和except的…… 题解列表 2024年04月20日 2 点赞 0 评论 1048 浏览 评分:10.0
蓝桥杯2014年第五届真题-兰顿蚂蚁(python) 解题思路:把蚂蚁的行动、动作当作对象,创建关于mayi()的的对象,并对蚂蚁行动关于黑格、白格等转向设置函数point(self),在主函数中对行走后原位置黑白格取反注意事项:此代码中,每个格子的参数类型为str,如果是int型,会导致一直导致答案错误, 题解列表 2024年04月20日 0 点赞 0 评论 654 浏览 评分:0.0
无聊的星期六 摘要:解题思路:注意事项:参考代码:s=int(input()) '''print('%.2f'%sum(i+ for i in range(s)))'&#…… 题解列表 2024年04月20日 0 点赞 0 评论 356 浏览 评分:0.0