编写题解 2788: 晶晶赴约会python 摘要:解题思路:注意事项:参考代码:n = int(input()) if n <= 5: if n % 2 == 0: print("YES") else:   题解列表 2024年03月06日 0 点赞 0 评论 373 浏览 评分:0.0
编写题解 2787: 有一门课不及格的学生 摘要:解题思路:判断语句注意事项:判断他是否恰好有一门课不及格参考代码:ch, ma = map(int, input().split()) if ch < 60 and ma >= 60 : …… 题解列表 2024年03月06日 1 点赞 0 评论 588 浏览 评分:4.0
最长不下降子序列的长度 摘要:解题思路:注意事项:参考代码:def lengthOfLIS(nums): if len(nums) <= 1: return len(nums) dp =…… 题解列表 2024年03月06日 0 点赞 0 评论 267 浏览 评分:0.0
2775: 等差数列末项计算python题解 摘要:解题思路:等差数列通项公式注意事项:先算公差参考代码:a1, a2, n = map(int, input().split()) d = a2-a1 an = a1+(n-1)*d print(…… 题解列表 2024年03月06日 0 点赞 0 评论 405 浏览 评分:9.9
三角形最大路径和 摘要:解题思路:注意事项:参考代码:def maximumTotal(triangle): n = len(triangle) dp = [[0] * n for _ in range(n)] …… 题解列表 2024年03月06日 0 点赞 0 评论 222 浏览 评分:0.0
信息学奥赛一本通T1331-后缀表达式的值-Python 摘要:解题思路:定义一个Stack和对应的push和pop方法,然后将数字全部push进栈,然后根据操作符来eval计算,最后将结果pop出来。注意事项:参考代码:class Stack: def…… 题解列表 2024年03月05日 0 点赞 0 评论 324 浏览 评分:9.9
编写题解 2002: 计算数字个数(Python) 摘要:解题思路:题解一:通过遍历字符串判断字符是否为数字参考代码:n=input() s1=0 for i in n: if i.isdigit(): s1+=1 prin…… 题解列表 2024年03月05日 0 点赞 0 评论 254 浏览 评分:0.0
平方差python解 摘要:解题思路:只有当x为奇数或4的倍数时才能拆分为两个数的平方差。注意事项:x-(x//2)求奇数的个数x//4求4的倍数的个数为了计算范围 [L, R] 内满足条件的数目,减去 f(L-1) 的目的是排…… 题解列表 2024年03月05日 0 点赞 1 评论 450 浏览 评分:6.0
动态规划 最长公共子序列 摘要:解题思路:注意事项:参考代码:a = list(input()) b = list(input()) la = len(a) lb =len(b) dp=[[0 for i in range(…… 题解列表 2024年03月05日 0 点赞 0 评论 449 浏览 评分:0.0
暴力法,蓝桥杯2020年第十一届省赛真题-回文日期 摘要:解题思路:注意事项:参考代码:from datetime import timedelta, datetime def pan1(day): for i in range(4): …… 题解列表 2024年03月05日 0 点赞 0 评论 345 浏览 评分:9.9