|
efine index int
int TOTAL_W;
int maxprofit = 0;
int numbest;
int bestset[N];
// 실험 1
//int p[N] = {50, 10, 40, 30};
//int w[N] = {10, 5, 2, 5};
// 실험 2
//int p[N] = {20, 30, 35, 12, 3};
//int w[N] = {2, 5, 7, 3, 1};
// 실험 3
int p[N];
int w[N];
int include[N];
unsigned int complex = 0;
void kna
|
- 페이지 9페이지
- 가격 1,000원
- 등록일 2007.06.09
- 파일종류 한글(hwp)
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
knapsack(index i, int profit, int weight) {
int promising(index, int, int);
int temp = 0;
// 최고의 값인 경우
if(weight <= TOTAL_W && profit >= maxprofit) {
// numbest를 고려한 아이템의 개수로 놓고, bestset을 이 해 답으로 놓는다.
maxprofit = (int)profit;
numbest = i;
bestset[i] = inc
|
- 페이지 9페이지
- 가격 1,000원
- 등록일 2007.06.09
- 파일종류 한글(hwp)
- 참고문헌 있음
- 최근 2주 판매 이력 없음
|
|
배낭의 중량 한계를 30kg이라고 했을때 총 10개의 보석을 배낭에 넣을경우
// 배낭의 중량을 넘지않는 한도에서의 가치의 최대는...
#include <stdio.h>
int n, w;
int Dymic[100][100]; //2차원 인접행렬
struct Knapsack
{
int weight;
int value;
};
|
- 페이지 3페이지
- 가격 1,500원
- 등록일 2009.02.19
- 파일종류 압축파일
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
int p[MAX+1];
int W, n;
int maxprofit;
// 우선순위 큐 ----------------------------------
static node PQ[MAX_Q_SIZE]; // 큐 배열
int qc=0; // 큐의 엔트리 개수
//----------------------------------
void knapsack(int, const int[], const int[], int, int&);
float bound(node);
|
- 페이지 3페이지
- 가격 2,000원
- 등록일 2005.12.01
- 파일종류 기타
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|
|
#define YES 1
#define NO 0
int n,W;
int numbest = 0;
int maxprofit = 0;
int *bestset;
int *include;
int *p, *w;
void knapsack(int,int,int);
bool promising(int,int,int);
int main()
{ 1. source code
2. 입력파일.txt
|
- 페이지 3페이지
- 가격 2,000원
- 등록일 2005.04.14
- 파일종류 압축파일
- 참고문헌 없음
- 최근 2주 판매 이력 없음
|