Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

RE了无数次了!!!!大侠帮帮忙啊,是不是数据很变态哦????

Posted by skytough at 2007-03-13 18:13:37 on Problem 3172
用的long long还是一样--!!

#include<stdio.h>
#include<stdlib.h>

#define MIN(a,b) a<b?a:b
#define MAX(a,b) a>b?a:b

long long int DP_backpack(int* ,int,int,long long int**);

int main()
{
 int N,C;
 int* w;
 long long int **m;
 long long int max;
 int i=0;
 
 scanf("%d%d",&N,&C);
 w = (int*)malloc((N+1)*sizeof(int));
 memset(w,0x00,sizeof(w));
 
 m = (long long int**)malloc((N+1)*sizeof(long long int*));
 for(i=0;i<=N;++i)
 {
     if(i>=1)
     scanf("%d",w+i);
	 m[i] = (long long int*)malloc((C+1)*sizeof(long long int));
 
 }
 memset(m,0x00,sizeof(m));
 max = DP_backpack(w,C,N,m); 
 //printf("%-I64d\n",max); 怎么这输出就RE,不输出就WA!!!!
 free(w);
 free(m);
 return 0;
}
DP_backpack(w,C,N,m){...}

Followed by:

Post your reply here:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator