1282: 公交汽车 dfs vs dp 摘要:### 这题比较简单,我采用了两种常见的方法来解答: ## 1:dfs(深度优先这题不可取,因为会时间超限87%) `其实这题用dfs的思想十分好理解——最优解型模板(参考[我的博客](https…… 题解列表 2022年07月04日 0 点赞 0 评论 301 浏览 评分:0.0
公交汽车 区间Dp 摘要:```cpp #include #include using namespace std; int n; int dp[105],a[15]; int main() { for (i…… 题解列表 2022年03月30日 0 点赞 0 评论 314 浏览 评分:9.9
公交汽车动态规划c++ 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>#include<cstring>…… 题解列表 2022年03月06日 0 点赞 0 评论 430 浏览 评分:0.0
公交汽车(python代码) 摘要:解题思路:注意事项:参考代码:fee = list(map(int,input().split()))n = int(input())dp = [99999999]*ndp[0] = fee[0]fo…… 题解列表 2022年02月07日 0 点赞 0 评论 438 浏览 评分:9.9
优质题解 公交汽车(C++) 摘要:- 定义变量 题目中说明有需要10个整数代表不同路程的费用,于是先声明一个数组(名为worth,长度为11,worth[0]为空,worth[1~10]表示一次性行走1~10公里所需费用) 接着定…… 题解列表 2022年02月07日 0 点赞 0 评论 913 浏览 评分:9.6
萌新:一个简单的完全背包问题 摘要:解题思路:注意事项:完全背包问题的状态转移方差:s[j]=max(s[j-w]+v,s[j])具体的max()函数的定义不能一概而论,要具体问题,具体思考参考代码:#include <iostream…… 题解列表 2021年09月21日 0 点赞 0 评论 203 浏览 评分:0.0
1282: 公交汽车 动态规划 摘要: import java.util.Scanner; public class test { public static void main(String…… 题解列表 2021年08月27日 0 点赞 0 评论 381 浏览 评分:0.0
题解 1282: 公交汽车 摘要:参考代码:#include <stdio.h>#include <stdlib.h>int minest(int a,int b){ return a<b?a:b;}int main(){ …… 题解列表 2021年05月23日 0 点赞 0 评论 297 浏览 评分:0.0
1282: 公交汽车-动态规划 摘要:```c #include int main() { int i,j,n,fei[15]={0},road[105]={0}; for(i=1;i=11) for(i=11;i…… 题解列表 2021年04月07日 0 点赞 0 评论 611 浏览 评分:6.8
编写题解 1282: 公交汽车 摘要:```java import java.util.Scanner; public class 公交汽车 { //10 10 30 5 5 60 70 80 90 100 // 17 pub…… 题解列表 2021年03月19日 0 点赞 0 评论 347 浏览 评分:0.0