数的计数(python) 摘要:解题思路:注意事项:参考代码:def count_numbers(n): # 创建一个长度为 n+1 的数组,用于存储中间结果 dp = [0] * (n + 1) # 初始化基本情…… 题解列表 2023年12月10日 0 点赞 0 评论 448 浏览 评分:0.0
分数求和(python) 摘要:解题思路:注意事项:参考代码:'''Python标准库中的fractions模块是用于处理有理数(Rational Numbers)的一个强大的工具。有理数是可以表示为两个整数…… 题解列表 2023年12月10日 0 点赞 0 评论 377 浏览 评分:0.0
围圈报数(python) 摘要:解题思路:注意事项:参考代码:def josephus(n, m): # 创建编号列表 people = list(range(1, n + 1)) # 记录出列的顺序 ord…… 题解列表 2023年12月10日 0 点赞 0 评论 352 浏览 评分:9.9
周末舞会(python) 摘要:解题思路:注意事项:参考代码:def dance_partner(men_count, women_count, dance_count): men_queue = list(range(1, …… 题解列表 2023年12月10日 0 点赞 0 评论 342 浏览 评分:0.0
1060:同因查找(python) 摘要:解题思路:注意事项:参考代码:for i in range(10,1001): if(i%2==0 and i%3==0 and i%7==0): print(i) …… 题解列表 2023年12月09日 0 点赞 0 评论 270 浏览 评分:0.0
编写题解 1160: 出圈(队列) 摘要:解题思路:把m-1个数加到后面之后,删除第一个数即可注意事项:参考代码:while True: try: n,m = map(int,input().split()) …… 题解列表 2023年12月09日 1 点赞 0 评论 367 浏览 评分:0.0
买笔程序(买最多的笔python简单粗暴) 摘要:解题思路:要买最多的笔,肯定优先买4元最便宜的,当钱不够买4元笔的时候就撤回之前买的一些笔。转而买5元和6元的笔让钱凑到零特点:简单粗暴参考代码:x = int(input())a = 0 # 6元…… 题解列表 2023年12月08日 0 点赞 0 评论 496 浏览 评分:9.9
地球人口承载力估计(python满分解答) 摘要:解题思路:牛吃草问题的变形,直接解方程组即可,更偏向于一道数学题参考代码:x, a, y, b = map(int, input().strip().split())p = float((x * a …… 题解列表 2023年12月08日 0 点赞 0 评论 510 浏览 评分:9.9
移动路线(Python) 摘要:解题思路:注意事项:参考代码:def countRoutes(m, n): dp = [[0] * (n+1) for _ in range(m+1)] # 初始化边界条件 for …… 题解列表 2023年12月08日 1 点赞 0 评论 261 浏览 评分:0.0
编写题解 2794: 求平均年龄 摘要:解题思路:注意事项:需要注意多行输入的单行输入的情况参考代码:list1 = list(map(int,input().rsplit()))n = list1[0]list1.pop(0)while …… 题解列表 2023年12月08日 0 点赞 6 评论 889 浏览 评分:7.3