我来告诉你高手怎么解题 摘要:from itertools import permutations options = [7, 6, 5, 4, 3, 2, 1] for perm in permutations(option…… 题解列表 2023年10月17日 0 点赞 0 评论 820 浏览 评分:9.9
字符串距离:一种典型动态规划 解题思路:在这个题目中,要求求两个字符串之间的最小距离,在初始化字符串的时候先分别考虑两个字符串为空的情况,当其中一个为空时,另外一个字符串对应的每一个字符的位置上都是加k(空字符与任意字符的距离),初始化完成后开始更新动规数组,其中dp[i][j]表示在A字符的前i个字符, 题解列表 2023年10月17日 0 点赞 0 评论 596 浏览 评分:9.9
温度转换Python 解题思路:注意事项:参考代码:F=float(input())c=5*(F-32)/9print("c=%.2f"%c) 题解列表 2023年10月17日 1 点赞 0 评论 1144 浏览 评分:0.0
天才的两种解法 摘要:while True: try: # 从输入中读取一个6位的正整数,表示金币的总重量 k = int(input()) - 265716 # 减去初始值…… 题解列表 2023年10月17日 0 点赞 0 评论 595 浏览 评分:9.9
贪心盾神与积木游戏(超时有点烦) 摘要:解题思路: 贪心点:先帮差值最小的完成积木作品注意事项:参考代码:# 时间超限: 64 分 运行时间: 6803ms m = int(input()) for _ in …… 题解列表 2023年10月16日 0 点赞 0 评论 415 浏览 评分:9.9
欣赏天才之作 摘要:import math def find_defective_ball(N): k = math.ceil(math.log(N, 3)) return k while Tru…… 题解列表 2023年10月16日 1 点赞 0 评论 758 浏览 评分:9.9
暴力寂寞的数 摘要:解题思路:想太多思维容易一坨,还是暴力吧。。注意事项:参考代码:def d(num): temp = [int(i) for i in str(num)] return num +…… 题解列表 2023年10月16日 0 点赞 0 评论 452 浏览 评分:9.9
暴力最小正整数 摘要:解题思路:想太多思维容易一坨,还是暴力吧。。注意事项:参考代码:def count(num): # 统计十进制数num的二进制形式中‘1’的个数 cnt = 0 …… 题解列表 2023年10月16日 0 点赞 1 评论 570 浏览 评分:9.9
看看天才怎么写的 摘要:def isprime(x): if x < 2: return False for i in range(2, int(x**0.5) + 1): & 题解列表 2023年10月16日 0 点赞 0 评论 554 浏览 评分:9.9
贪心快乐司机 摘要:解题思路:跟金银岛一样,https://blog.dotcpp.com/a/98826注意事项:参考代码:n,w = map(int,input().split()) gi = [] # 重量…… 题解列表 2023年10月16日 0 点赞 0 评论 767 浏览 评分:9.9