动态规划思路详解-贪吃的大嘴 摘要:解题思路:注意事项:参考代码:def find_cakes(cakes, m): # 初始化动态规划数组,dp[i][j]表示前i个小蛋糕中选择若干个,美味度之和为j所需的最小数量 …… 题解列表 2024年03月06日 0 点赞 0 评论 150 浏览 评分:0.0
冒泡排序思想,直接比较大小 摘要:解题思路:使用冒泡排序思想,直接用strcmp()函数比较字符串大小即可参考代码:#include<stdio.h> #include<string.h> int main(){ char a…… 题解列表 2024年03月06日 0 点赞 0 评论 140 浏览 评分:0.0
计算一个整数N的阶乘-python 摘要:解题思路:递归解法,注意n=0的情况,阶乘也是1.注意事项:参考代码:def factorial(n): if n == 0: return 1 elif n =…… 题解列表 2024年03月06日 0 点赞 0 评论 184 浏览 评分:0.0
自定义函数求一元二次方程 摘要:解题思路:注意事项:参考代码:void root1(float a, float b, float delta){ float m1=-(b/2/a); float m2= (pow(de…… 题解列表 2024年03月07日 0 点赞 0 评论 152 浏览 评分:0.0
过滤多余的空格 摘要:解题思路:注意事项:参考代码:#include<bits/stdc++.h>using namespace std;int main(){ string s; getline(cin,s); stri…… 题解列表 2024年03月07日 0 点赞 0 评论 272 浏览 评分:0.0
小心:一系列整数可能会有相同的数 摘要:解题思路:注意事项:参考代码:#include <iostream>#include <algorithm>#include <vector>using namespace std;struct tr…… 题解列表 2024年03月07日 0 点赞 0 评论 192 浏览 评分:0.0
编写题解 3047: Crossing River 摘要:```python global times times=[] def crossingriver(p_list): p_list.sort()#顺序排列 time=0#…… 题解列表 2024年03月07日 0 点赞 0 评论 177 浏览 评分:0.0
公共子序列 摘要:解题思路:注意事项:参考代码:def longestCommonSubsequence(X, Y): m, n = len(X), len(Y) dp = [[0] * (n+1) for…… 题解列表 2024年03月07日 0 点赞 0 评论 119 浏览 评分:0.0
python编写题解 2792: 三角形判断 摘要:解题思路:三角形的三边关系:任意两边之和大于第三边或者任意两边之差小于第三边。参考代码:a, b, c = map(int, input().split()) if a+b > c and a+c …… 题解列表 2024年03月07日 0 点赞 0 评论 371 浏览 评分:0.0