2013年11月19日
摘要: 算法:分两步:1、建图 2、从底到上逐个求每个点的最小费用。具体实现见程序注释。#include #include#includeusing namespace std;const int MAX=120;int M,N,X,T,V; //等级限制 物品总数 替代品总数 替代品的编号 优惠价格int map[MAX][MAX]; //初始化全为0 map[i][j]=-1:i和j不能交换物品 map[i][j]=t:物品i可以用物品j加t金币替换int topo[MAX]; //对于处理完的图,从底向上编号 topo[i]=j:第... 阅读全文
posted @ 2013-11-19 21:26 天梦Interact 阅读(189) 评论(0) 推荐(0) 编辑