Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
answer:In Reply To:晕,喜欢先进DISCUSSION的后果就是这种简单题也会WA好几次... Posted by:mayp at 2007-03-28 22:04:38 #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 ); return 0 ; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator