3030基础解法(Python) 摘要:解题思路:恰如title注意事项:理解库函数即可参考代码:import itertoolss = input()for data in itertools.permutations(s, len(s)…… 题解列表 2023年02月28日 0 点赞 0 评论 583 浏览 评分:2.0
3033基础解法(Python) 摘要:解题思路:排列组合类型的题目只要数据量不是很大,基本用自带的函数就行了注意事项:注意本题可以重复取一个值,所以用itertools.combinations_with_replacement参考代码:…… 题解列表 2023年02月28日 0 点赞 0 评论 567 浏览 评分:9.9
3021基础解法(Python) 摘要:注意事项:题目下标问题参考代码:n_num = int(input())for i in range(n_num) : n_in = int(input()) if n_in == 1 :…… 题解列表 2023年02月28日 0 点赞 0 评论 399 浏览 评分:9.9
dfs简单且明了-Python 摘要:解题思路:就是想吐槽一下:题目都说了由不同字母组成 但是测试用例有相同的 害我第一次没通过 真老6注意事项:方法:就是要用下标1-n来对应input输入的字母保证不会重复 最后再输出下标对应的字母就o…… 题解列表 2023年02月28日 0 点赞 0 评论 796 浏览 评分:8.0
[编程入门]自定义函数处理素数 摘要:解题思路:注意事项:参考代码:from math import sqrtdef isPrime(n): if n==1: return False for j in rang…… 题解列表 2023年02月27日 0 点赞 0 评论 223 浏览 评分:0.0
python解决复数求和问题 摘要:解题思路:首先输入行数,其中n代表几行其次定义变量,分别输入实部和虚部a,b最后对实部 虚部分别进行求和即可参考代码:n=int(input()) s,x=0,0 for _ in range(n…… 题解列表 2023年02月27日 0 点赞 0 评论 276 浏览 评分:0.0
2869: 字符串最大跨距 摘要:解题思路:注意事项:参考代码:s,s1,s2 = input().strip().split(",") if s1 in s and s2 in s: a = s.index(s1) …… 题解列表 2023年02月26日 0 点赞 0 评论 324 浏览 评分:2.0
2867: 单词的长度(python) 摘要:解题思路:注意事项:参考代码:s = list(input().strip().split()) l = [str(len(i)) for i in s] print(",".join(l))…… 题解列表 2023年02月26日 0 点赞 0 评论 452 浏览 评分:9.9
2866: 过滤多余的空格(python) 摘要:解题思路:注意事项:参考代码:s = list(input().strip().split()) print(" ".join(s))…… 题解列表 2023年02月26日 0 点赞 0 评论 387 浏览 评分:9.9
2864: 单词替换(python) 摘要:解题思路:注意事项:参考代码:#注意去掉前导后导空格 #先把字符串转为列表,直接用replace会有问题(比如句子中的want可能ant会被替换) s = list(input().strip()…… 题解列表 2023年02月26日 1 点赞 1 评论 397 浏览 评分:9.9