作者:Hawstein 一切都要从一则故事说起。 话说有一哥们去森林里玩发现了一堆宝石,他数了数,一共有n个。 但他身上能装宝石的就只有一个背包,背包的容量为C。这哥们把n个宝石排成一排并编上号: 0,1,2,…,n-1。第i个宝石对应的体积和价值分别为V[i]和W[i] 。排好后这哥们开始思考: 背包总共也就只能装下体积为C的东西,那我要装下哪些宝石才能让我获得最大的利益呢? OK,如
Computer Time Limit: 1000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 5508 Accepted Submission(s): 2748 Problem Description A school boug
饭卡 Time Limit: 5000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others) Total Submission(s): 19702 Accepted Submission(s): 6867 Problem Description 电子科大本部食堂的饭卡有一种很诡异的
Super Jumping! Jumping! Jumping!Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 28091 Accepted Submission(s): 12529Problem Descript
Bridging signalsTime Limit: 5000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 1169 Accepted Submission(s): 767Problem Description'Oh no, they'v
Constructing Roads In JGShining's KingdomTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 19340 Accepted Submission(s): 5473Problem
Greatest Common Increasing SubsequenceTime Limit: 2000/1000 MS (Java/Others) Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5384 Accepted Submission(s): 1742Problem Desc
//LIS 最长上升子序列 o(n^2)/*arr[k]>arr[i]&&dp[k]<dp[i]+11 3 4 2 5 2 2 2 2 3 2 3 2 4*/#include #include #include using namespace std;const int maxn=1000+10;int arr[maxn],dp[maxn]; //d
题目:http://hihocoder.com/problemset/problem/1270//还是要静下心来好好想想,想通了再写。。。 乱交一点意义都没有//还是学长说的对:"提交简单,AC不易,且敲且叹息”。。。//这题是个完全背包不过稍有变形 完全背包求得是给你一个背包V问装满V可以取得最大值,此题是取得最小值。//不过需要注意题目要求可以溢出 就是物品的容量即使大于V也可
数塔
Copyright © 2005-2024 51CTO.COM 版权所有 京ICP证060544号