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

果断补上代码

Posted by jufusong at 2013-05-28 10:38:15 on Problem 2084
In Reply To:dp写完才发现是个高精度 Posted by:jufusong at 2013-04-02 19:59:51
import java.io.*;
import java.math.*;
import java.util.*;
public class Main {
	public static void main ( String [] args ) {
		Scanner cin = new Scanner ( System . in ) ;
		BigInteger dp[] = new BigInteger [110] ;
		dp[0]=BigInteger.valueOf(1);
		dp[1]=BigInteger.valueOf(1);
		dp[2]=BigInteger.valueOf(2);
		for ( int i = 3 ; i <= 100 ; i ++ ) {
			dp[i]=BigInteger.valueOf(0);
			for ( int j = 0 ; j < i ; j ++ ) {
				dp[i]=dp[i].add(dp[j].multiply(dp[i-j-1]));
			}
		}
		while ( cin . hasNext ( ) ) {
			int x ;
			x = cin . nextInt ( ) ;
			if ( x == -1 ) {
				break ;
			}
			System.out.println(dp[x]) ;
		}
	}
}

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