暴力 只过了一个 ,其他内存超限初学实在不会改 摘要:解题思路:就是直接模拟题目注意事项:只过了一个,其他内存超限 放这里也是想听大伙的意见参考代码:from itertools import permutations n = int(input())…… 题解列表 2024年02月20日 0 点赞 0 评论 254 浏览 评分:2.0
1042: [编程入门]电报加密 摘要:解题思路:注意事项:参考代码:c=str(input())for i in c: if 'a'<=i<='z' or 'A'<=i<='Z…… 题解列表 2024年02月20日 0 点赞 0 评论 168 浏览 评分:0.0
就是0,1背包问题 摘要:参考代码:# 获取输入的两个整数T和M,分别表示背包容量和物品数量T, M = map(int, input().split())# 初始化动态规划数组dp,长度为T+1,用于存储背包容量从0到T的最…… 题解列表 2024年02月20日 0 点赞 0 评论 167 浏览 评分:0.0
删除数组中的0元素 摘要:解题思路:倒着删除或者取非0元素就行,需要考虑的只有数组长度改变的问题参考代码:a=int(input())b=list(map(int,input().split()))for i in range…… 题解列表 2024年02月20日 0 点赞 0 评论 606 浏览 评分:9.9
龟兔赛跑预测 摘要:解题思路:按题给条件模拟就行注意事项:兔子可能二次或多次停顿,if条件严格点就行;乌龟如果提前到终点了就break,不要等停顿时间结束了再结束计时参考代码:v1,v2,t,s,l=map(int,in…… 题解列表 2024年02月20日 0 点赞 0 评论 289 浏览 评分:9.9
高精度加法:一句代码解决 摘要:解题思路:python自带高精度,就是数据处理用的参考代码:print(sum([int(input()) for _ in range(2)]))…… 题解列表 2024年02月20日 0 点赞 0 评论 314 浏览 评分:9.9
高精度阶乘计算 摘要:解题思路:python里可以用math库里的factorial方法,就是高精度的参考代码:from math import factorialprint(factorial(int(input()))…… 题解列表 2024年02月20日 0 点赞 0 评论 197 浏览 评分:9.9
编写题解 1103: 开心的金明 摘要:解题思路:动态规划,背包问题注意事项:参考代码:N, m = map(int, input().split())sub_value = []sub_importance = []for _ in ra…… 题解列表 2024年02月19日 0 点赞 0 评论 225 浏览 评分:0.0
题目2821:开关灯的Python解法之一 摘要:解题思路:注意事项:参考代码:N, M = map(int, input().split()) sheet = [] #新建空列表 for i in range(1, N + 1): s…… 题解列表 2024年02月19日 1 点赞 0 评论 286 浏览 评分:0.0
斐波纳契数列 摘要:解题思路:注意事项:参考代码:n=int(input())L=[1,1]for i in range(2,n): L.append(L[i-2]+L[i-1])if n==1: print…… 题解列表 2024年02月18日 0 点赞 0 评论 134 浏览 评分:0.0