公交汽车(完全背包) 摘要:解题思路:完全背包注意事项:参考代码:#include<bits/stdc++.h>usingnamespacestd;constint&nbs…… 题解列表 2025年07月30日 0 点赞 0 评论 305 浏览 评分:0.0
1282: 公交汽车 dp和dfs 还是dfs更好用 摘要:解题思路:注意事项:参考代码:#include"bits/stdc++.h" using namespace std; int a[11],n,kkk[110]; void dfs(int x,…… 题解列表 2024年12月14日 0 点赞 0 评论 451 浏览 评分:0.0
题目 1282: 公交汽车(培养这类题的感觉) 解题思路://先分别求到1,2,3,。。。15站的min//第15站的min是踩在前面站的min上来的//i=2,k=1;minv=min(minv,dp[1]+pri[1])=min(50000,12+12)=24//因为i>=k,所以还可以继续内循环, 题解列表 2024年03月15日 0 点赞 0 评论 700 浏览 评分:9.9
1282: 公交汽车,c++代码实现,通俗易懂,超级详细 摘要:#1282: 公交汽车,c++代码实现 ####题目描述: [DOTCPP1282公交汽车](http://https://www.dotcpp.com/oj/problem1282.html "…… 题解列表 2023年08月22日 2 点赞 0 评论 1005 浏览 评分:9.9
1282: 公交汽车 ```cpp#include#defineMAX101#defineINF50001#defineA_JOURNEY10usingnamespacestd;inlineintmin(inta,intb){returna 题解列表 2023年04月15日 0 点赞 0 评论 622 浏览 评分:9.9
记忆化搜索 摘要:解题思路:自顶而下搜索最小值注意事项:记录答案防止时间爆炸参考代码:#include<bits/stdc++.h>#define endl '\n'using namespace st…… 题解列表 2023年02月06日 0 点赞 0 评论 446 浏览 评分:0.0
公交汽车 区间Dp ```cpp#include#includeusingnamespacestd;intn;intdp[105],a[15];intmain(){for(inti=1;i>a[i];cin>>n;dp[0]=0;for(inti=1;i 题解列表 2022年03月30日 0 点赞 0 评论 620 浏览 评分:9.9
公交汽车动态规划c++ 摘要:解题思路:注意事项:参考代码:#include<iostream>#include<cstdio>#include<algorithm>#include<cmath>#include<cstring>…… 题解列表 2022年03月06日 0 点赞 0 评论 750 浏览 评分:0.0
优质题解 公交汽车(C++) -定义变量题目中说明有需要10个整数代表不同路程的费用,于是先声明一个数组(名为worth,长度为11,worth[0]为空,worth[1~10]表示一次性行走1~10公里所需费用)接着定义dp数组(dp[0]=0),下标i为走过的总路程,dp[i]表示走过i公里所需的最小费用。 题解列表 2022年02月07日 0 点赞 0 评论 1310 浏览 评分:9.6
动态规划c++ 摘要:解题思路:求出每一段路的最优情况,然后求得最小值参考代码:#include <iostream> #include <algorithm> using namespace std; int m…… 题解列表 2021年02月24日 0 点赞 1 评论 958 浏览 评分:9.9