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

连sample都没过,竟然AC了-_-~~~~~~~~~~!!hawk在吗?帮忙看看是怎么回事。测试数据没包括sample?

Posted by bakey at 2005-08-28 22:51:26 on Problem 1157
#include <stdio.h>
#include <string.h>
#define max(a,b) a>b?a:b
int main()
{
	

	int f,v,value[120][120],table[120][120];
	int i,j;

	while (scanf("%d%d",&f,&v) != -1)
	{
		for (i = 1;i <= f;i ++)
		{
			for (j = 1; j <= v;j ++)
				scanf("%d",&table[i][j]);
		}
		for (i = 1;i <= f;i ++)
			value[0][i] = -0x7fffffff;
		value[0][0] = 0;
		for (i = 1; i <= v;i ++)
		{
			for (j = 1; j <= f;j ++)
			{
				if (j <= i)
					value[i][j] = max(value[i-1][j-1]+table[j][i],value[i-1][j]);
				else value[i][j] = -0x7fffffff;
			}
		}
		printf("%d\n",value[v][f]);
	}
	return 0;
}

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