题解 1062: 二级C语言-公约公倍 摘要:解题思路:最大公约数:分别获得2数的所有约数,然后取交集,然后取交集的最大值最小公倍数:循环增加a的倍数,当可以整除b时,跳出循环,即为最小公倍数注意事项:1 需要考虑多次输入的情况2 生成集合set…… 题解列表 2022年03月28日 0 点赞 0 评论 640 浏览 评分:8.0
题目 1446: 蓝桥杯2013年第四届真题-核桃的数量 摘要:解题思路:类似求三个数的最小公倍数注意事项:参考代码:a, b, c = map(int, input().strip().split())for i in range(min(a, b, c), a…… 题解列表 2022年03月28日 0 点赞 0 评论 221 浏览 评分:0.0
饮料换购python版解答 摘要:解题思路:本题主要使用模拟的思路进行求解,在确定while的结束条件的时候需要注意,当n=2的时候如果讲两个空瓶都用完还可以再去换购一次,所以要当心他的条件注意事项:参考代码: …… 题解列表 2022年03月28日 0 点赞 0 评论 308 浏览 评分:2.7
简单dp-走方格 摘要:```python n,m = map(int,input().split()) dp = [[0 for j in range(m+1)] for i in range(n+1)] dp[1]…… 题解列表 2022年03月28日 0 点赞 0 评论 581 浏览 评分:0.0
九宫重排【Python】【BFS+降维+hash判重】 摘要:```python from collections import deque from typing import List direct = [3, -3, -1, 1] def chec…… 题解列表 2022年03月27日 0 点赞 0 评论 867 浏览 评分:9.9
利用扩展的列表,集中处理 摘要:解题思路:通过列表扩展,利用队列中只有一个断号和重复的,且整个队列是连续的特性解决注意事项:没有,这个方法很棒参考代码:# 错误票据N=int(input())data=[]for i in rang…… 题解列表 2022年03月27日 0 点赞 0 评论 244 浏览 评分:9.9
树状数组,python 摘要:解题思路:注意事项:参考代码:n=int(input())h=list(map(int,input().split()))maxh=max(h)cnt=[0]*(n)c=[0]*(maxh+2)#c[…… 题解列表 2022年03月27日 0 点赞 1 评论 512 浏览 评分:9.0
题解 1061: 二级C语言-计负均正(Python) 摘要:解题思路:注意事项:需要输入两行数字才能成功参考代码:x=input().split()y=input().split()m=[int(i) for i in x+y if int(i)<0]n=[i…… 题解列表 2022年03月27日 0 点赞 0 评论 263 浏览 评分:8.0
[编程入门]水仙花数判断 摘要:解题思路:将三位数每一位分离出来是重点注意事项:参考代码:for i in range(100,1000): a=i%10 b=(i%100)/10 c=i/100 if i=…… 题解列表 2022年03月27日 0 点赞 0 评论 199 浏览 评分:0.0
模拟过程,注意判断条件 摘要:解题思路:注意事项:参考代码:T = int(input()) for _ in range(T): n = int(input()) matrix = [list(inpu…… 题解列表 2022年03月27日 0 点赞 0 评论 157 浏览 评分:0.0