[编程入门]最大公约数与最小公倍数 超简单 纯纯小白做法 解题思路:最大公约数求法1.辗转相除法2.相减法最小公倍数求法注意事项:我用的是辗转相除法,两个整数m,n。m%n得余数a;(1)a==0,即n为最大公约数;(2)a!=0,则把m=n,n=a;然后一直代入直到余数a==0。参考代码:```c#includeintmain(){intm, 题解列表 2022年08月11日 0 点赞 0 评论 556 浏览 评分:9.9
地宫取宝DP解法 摘要:解题思路:注意事项:参考代码:#include<iostream> using namespace std; const int N=60,mod=1e9+7; int f[N][N][13][…… 题解列表 2022年08月12日 0 点赞 0 评论 652 浏览 评分:9.9
这个程度为啥是中等题? 摘要:解题思路:注意事项:参考代码:a,b=map(int,input().split()) c=0 for i in range(a,b+1): if i%3==1 and i%5==3: …… 题解列表 2022年08月12日 0 点赞 0 评论 740 浏览 评分:9.9
混个经验值 摘要:解题思路:注意事项:参考代码:a=list(map(int,input().split())) a=sorted(a,reverse=False) for i in a: print(i…… 题解列表 2022年08月12日 0 点赞 0 评论 700 浏览 评分:9.9
混个经验值 摘要:解题思路:注意事项:参考代码:a=list(map(int,input().split())) a=sorted(a,reverse=True) for i in a: print(i,…… 题解列表 2022年08月12日 0 点赞 0 评论 639 浏览 评分:9.9
两种方式表示列表最后一个元素 摘要:解题思路:注意事项:参考代码:方法一:a=list(map(int,input().split())) b=len(a) while a[b-1]!=-1: a.extend(list(…… 题解列表 2022年08月13日 0 点赞 0 评论 765 浏览 评分:9.9
思路简单, 摘要:解题思路:注意事项:参考代码n=int(input()) c=0 a=1 for i in range(1,n+1): for j in range(1,i+1): …… 题解列表 2022年08月13日 0 点赞 0 评论 605 浏览 评分:9.9
没什么特别的 摘要:解题思路:注意事项:参考代码:a,n=map(int,input().split()) s=0 b=str(a) for i in range(n): s+=int(b) a…… 题解列表 2022年08月13日 0 点赞 0 评论 618 浏览 评分:9.9
蓝桥杯算法提高VIP-进制转换(c++) 解题思路:这题就是转换进制,第一个输出要去前导零(为什么我开始没想到!害我调了好久的BUG(QAQ))第二个输出大家懂得都懂(十六转十)但记得字符转整型时要调整(详细见ASCLL码表)(快一点可以用cmath库的计算次方)计算次方代码:pow(底数, 题解列表 2022年08月13日 0 点赞 0 评论 602 浏览 评分:9.9
数字三角形 摘要:解题思路:DFS注意事项:参考代码:#include <bits/stdc++.h>using namespace std;int n,a[30][30],ans = -1;void dfs(int …… 题解列表 2022年08月13日 0 点赞 0 评论 696 浏览 评分:9.9