题解列表

筛选

围圈报数(python)

摘要:解题思路:注意事项:参考代码:def josephus(n, m):    # 创建编号列表    people = list(range(1, n + 1))    # 记录出列的顺序    ord……

周末舞会(python)

摘要:解题思路:注意事项:参考代码:def dance_partner(men_count, women_count, dance_count):    men_queue = list(range(1, ……

1060:同因查找(python)

摘要:解题思路:注意事项:参考代码:for i in range(10,1001):    if(i%2==0 and i%3==0 and i%7==0):        print(i)    ……

编写题解 1160: 出圈(队列)

摘要:解题思路:把m-1个数加到后面之后,删除第一个数即可注意事项:参考代码:while True:    try:        n,m = map(int,input().split())       ……

买笔程序(买最多的笔python简单粗暴)

摘要:解题思路:要买最多的笔,肯定优先买4元最便宜的,当钱不够买4元笔的时候就撤回之前买的一些笔。转而买5元和6元的笔让钱凑到零特点:简单粗暴参考代码:x = int(input())a = 0  # 6元……

移动路线(Python)

摘要:解题思路:注意事项:参考代码:def countRoutes(m, n):    dp = [[0] * (n+1) for _ in range(m+1)]    # 初始化边界条件    for ……

编写题解 2794: 求平均年龄

摘要:解题思路:注意事项:需要注意多行输入的单行输入的情况参考代码:list1 = list(map(int,input().rsplit()))n = list1[0]list1.pop(0)while ……

编写题解 2796: 求整数的和与均值

摘要:解题思路:注意事项:  此题需要考虑一行输入和多行输入的情况参考代码:list1 = list(map(int,input().rsplit()))n = list1[0]list1.pop(0)wh……

超级楼梯(Python)

摘要:解题思路:注意事项:参考代码:def super_stair_ways(m):    dp = [0] * (m + 1)    dp[1] = 1    for i in range(2, m + ……