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

晕,喜欢先进DISCUSSION的后果就是这种简单题也会WA好几次...

Posted by mayp at 2007-03-28 22:04:38 on Problem 1949
In Reply To:谁能告诉我怎么错的? 我理直气壮地说。 昨晚被1002搞得发晕,今天竟让这破题WA了 。。。。。。。。。。。。。。。。。。。。。 Posted by:31311069 at 2004-11-01 21:59:35
将10000改为10001就可以了...
#include<stdio.h>
int main ()
{
	int t[10001] , i , n , pre ,npre , temp , time ,tt ;
	scanf ( "%d",&n );
	time=0;
    for(i=1;i<=n;i++)
	{
		scanf ( "%d%d",&temp,&npre );
		tt =  0 ;
		while ( npre--)
		{
			scanf ( "%d",&pre ) ;
			if ( tt < t[pre] )
				tt = t[pre] ;
		}
		t[i] = temp + tt ;
		if ( time < t[i] )
			time = t[i] ;
	}
	printf ( "%d\n",time );
	while(1){}
	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