C++ 出现'min' : undeclared identifier 一下为代码,大神看看错误!!!
#include#include#definemaxn(1000+100)usingnamespacestd;intweight,length,n;inta[20],lo...
#include
#include
#define maxn (1000+100) using namespace std; int weight,length,n; int a[20],low[maxn][20],w[maxn]; double f[maxn]; void init() { freopen("convoy.in","r",stdin); freopen("convoy.out","w",stdout); } void readdata() { scanf("%d%d%d",&weight,&length,&n); int i,j,k; for(i=1;i<=n;i++)scanf("%d%d",&w[i],&low[i][0]); for(i=a[0]=1;i<=10;i++)a[i]=a[i-1]*2; low[0][0]=100000000; for(j=1;j<=10;j++) for(i=0;i<=n-a[j]+1;i++) low[i][j]=min(low[i][j-1],low[i+a[j-1]][j-1]); } 展开
#include
#define maxn (1000+100) using namespace std; int weight,length,n; int a[20],low[maxn][20],w[maxn]; double f[maxn]; void init() { freopen("convoy.in","r",stdin); freopen("convoy.out","w",stdout); } void readdata() { scanf("%d%d%d",&weight,&length,&n); int i,j,k; for(i=1;i<=n;i++)scanf("%d%d",&w[i],&low[i][0]); for(i=a[0]=1;i<=10;i++)a[i]=a[i-1]*2; low[0][0]=100000000; for(j=1;j<=10;j++) for(i=0;i<=n-a[j]+1;i++) low[i][j]=min(low[i][j-1],low[i+a[j-1]][j-1]); } 展开
2个回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询