开心的金明 (Java代码) 摘要:解题思路:注意事项:参考代码:import java.util.Scanner; public class 开心的金明 { static int m; static int max=0; st…… 题解列表 2018年03月13日 1 点赞 0 评论 693 浏览 评分:0.0
开心的金明 (C++代码) 摘要:解题思路:应该是用dp做的,然而并不会...强行DFS还是可以过的,可以承受20以内数据量的打击注意事项:哪个大佬来教我一下dp哈参考代码:#include <iostream> #define…… 题解列表 2018年10月13日 0 点赞 0 评论 557 浏览 评分:0.0
开心的金明 (C语言代码) 摘要:解题思路:注意事项:参考代码:#include<stdio.h>int v[30],p[30];long long x[30001];int main(){ int n,m,i,j,k; scanf(…… 题解列表 2018年02月09日 0 点赞 0 评论 1025 浏览 评分:0.0
开心的金明 (C++代码) 摘要:#include<bits/stdc++.h> using namespace std; typedef long long ll; ll n,m; ll dp[100000],v[10000…… 题解列表 2018年11月13日 0 点赞 0 评论 462 浏览 评分:0.0
开心的金明 (C语言代码) 摘要:解题思路:01背包,价值加个乘法而己注意事项:参考代码:#include<stdio.h>#include<string.h>int max(long int a,long int b){ re…… 题解列表 2017年12月19日 0 点赞 2 评论 695 浏览 评分:0.0
开心的金明 (C++代码)(DP动态规划,01背包问题) 摘要:解题思路:注意事项:参考代码:#include<stdio.h> #include<algorithm> int main() { int money,m; scanf(…… 题解列表 2019年02月02日 2 点赞 0 评论 720 浏览 评分:2.0
开心的金明 (C++代码) 摘要:解题思路:注意事项:参考代码:/*P1060 题解含价值的01背包*/#include <cstdio>//头文件int t[1000001],m[1000001],f[1000001];//t数组是…… 题解列表 2017年12月26日 1 点赞 0 评论 1191 浏览 评分:2.0
开心的金明-C语言 摘要:解题思路: 典型0/1背包问题,套用0/1背包问题公式sum[i][j]=max(sum[i-1][j],sum[i-1][j-v[i]]+p[i]*v[i])即可。总钱数N代表背包容量,物品…… 题解列表 2022年08月19日 0 点赞 0 评论 317 浏览 评分:4.7
开心的金明-题解(C语言代码)----------菜鸟级 摘要:DP(动态)规划的精髓就是把复杂的问题分解成若个个具有最优解的子问题并通过每个子问题的最优解退出大问题的最优解。是解决背包问题的常用方法哟。 其中的#define max(a,b) a>b?a:…… 题解列表 2019年11月17日 0 点赞 0 评论 1079 浏览 评分:5.6
开心的金明 (C语言代码) 摘要:递归:#include <stdio.h> #include <stdlib.h> int n,m; typedef struct Node { int price; …… 题解列表 2019年01月08日 0 点赞 0 评论 878 浏览 评分:5.9